4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-view-BoundList'>/**
19 </span> * @class Ext.view.BoundList
20 * @extends Ext.view.View
21 * An internal used DataView for ComboBox, MultiSelect and ItemSelector.
23 Ext.define('Ext.view.BoundList', {
24 extend: 'Ext.view.View',
25 alias: 'widget.boundlist',
26 alternateClassName: 'Ext.BoundList',
27 requires: ['Ext.layout.component.BoundList', 'Ext.toolbar.Paging'],
29 <span id='Ext-view-BoundList-cfg-pageSize'> /**
30 </span> * @cfg {Number} pageSize If greater than <tt>0</tt>, a {@link Ext.toolbar.Paging} is displayed at the
31 * bottom of the list and store queries will execute with page start and
32 * {@link Ext.toolbar.Paging#pageSize limit} parameters.
36 <span id='Ext-view-BoundList-property-pagingToolbar'> /**
37 </span> * @property pagingToolbar
38 * @type {Ext.toolbar.Paging}
39 * A reference to the PagingToolbar instance in this view. Only populated if {@link #pageSize} is greater
40 * than zero and the BoundList has been rendered.
45 baseCls: Ext.baseCSSPrefix + 'boundlist',
53 componentLayout: 'boundlist',
55 renderTpl: ['<div class="list-ct"></div>'],
57 initComponent: function() {
60 itemCls = baseCls + '-item';
62 me.selectedItemCls = baseCls + '-selected';
63 me.overItemCls = baseCls + '-item-over';
64 me.itemSelector = "." + itemCls;
67 me.addCls(baseCls + '-floating');
71 // should be setting aria-posinset based on entire set of data
73 me.tpl = Ext.create('Ext.XTemplate',
74 '<ul><tpl for=".">',
75 '<li role="option" class="' + itemCls + '">' + me.getInnerTpl(me.displayField) + '</li>',
76 '</tpl></ul>'
78 } else if (Ext.isString(me.tpl)) {
79 me.tpl = Ext.create('Ext.XTemplate', me.tpl);
83 me.pagingToolbar = me.createPagingToolbar();
88 Ext.applyIf(me.renderSelectors, {
93 createPagingToolbar: function() {
94 return Ext.widget('pagingtoolbar', {
95 pageSize: this.pageSize,
101 onRender: function() {
103 toolbar = me.pagingToolbar;
104 me.callParent(arguments);
106 toolbar.render(me.el);
110 bindStore : function(store, initial) {
112 toolbar = me.pagingToolbar;
113 me.callParent(arguments);
115 toolbar.bindStore(store, initial);
119 getTargetEl: function() {
120 return this.listEl || this.el;
123 getInnerTpl: function(displayField) {
124 return '{' + displayField + '}';
127 refresh: function() {
130 if (me.isVisible()) {
132 me.doComponentLayout();
137 initAria: function() {
140 var selModel = this.getSelectionModel(),
141 mode = selModel.getSelectionMode(),
142 actionEl = this.getActionEl();
144 // TODO: subscribe to mode changes or allow the selModel to manipulate this attribute.
145 if (mode !== 'SINGLE') {
146 actionEl.dom.setAttribute('aria-multiselectable', true);
150 onDestroy: function() {
151 Ext.destroyMembers(this, 'pagingToolbar', 'listEl');