4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/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> * An internally used DataView for {@link Ext.form.field.ComboBox ComboBox}.
21 Ext.define('Ext.view.BoundList', {
22 extend: 'Ext.view.View',
23 alias: 'widget.boundlist',
24 alternateClassName: 'Ext.BoundList',
25 requires: ['Ext.layout.component.BoundList', 'Ext.toolbar.Paging'],
27 <span id='Ext-view-BoundList-cfg-pageSize'> /**
28 </span> * @cfg {Number} pageSize
29 * If greater than `0`, a {@link Ext.toolbar.Paging} is displayed at the bottom of the list and store
30 * queries will execute with page {@link Ext.data.Operation#start start} and
31 * {@link Ext.data.Operation#limit limit} parameters. Defaults to `0`.
35 <span id='Ext-view-BoundList-property-pagingToolbar'> /**
36 </span> * @property {Ext.toolbar.Paging} pagingToolbar
37 * A reference to the PagingToolbar instance in this view. Only populated if {@link #pageSize} is greater
38 * than zero and the BoundList has been rendered.
43 baseCls: Ext.baseCSSPrefix + 'boundlist',
44 itemCls: Ext.baseCSSPrefix + 'boundlist-item',
52 componentLayout: 'boundlist',
54 renderTpl: ['<div id="{id}-listEl" class="list-ct"></div>'],
56 initComponent: function() {
61 me.selectedItemCls = baseCls + '-selected';
62 me.overItemCls = baseCls + '-item-over';
63 me.itemSelector = "." + itemCls;
66 me.addCls(baseCls + '-floating');
70 // should be setting aria-posinset based on entire set of data
72 me.tpl = Ext.create('Ext.XTemplate',
73 '<ul><tpl for=".">',
74 '<li role="option" class="' + itemCls + '">' + me.getInnerTpl(me.displayField) + '</li>',
75 '</tpl></ul>'
77 } else if (Ext.isString(me.tpl)) {
78 me.tpl = Ext.create('Ext.XTemplate', me.tpl);
82 me.pagingToolbar = me.createPagingToolbar();
87 me.addChildEls('listEl');
90 createPagingToolbar: function() {
91 return Ext.widget('pagingtoolbar', {
92 pageSize: this.pageSize,
98 onRender: function() {
100 toolbar = me.pagingToolbar;
101 me.callParent(arguments);
103 toolbar.render(me.el);
107 bindStore : function(store, initial) {
109 toolbar = me.pagingToolbar;
110 me.callParent(arguments);
112 toolbar.bindStore(store, initial);
116 getTargetEl: function() {
117 return this.listEl || this.el;
120 getInnerTpl: function(displayField) {
121 return '{' + displayField + '}';
124 refresh: function() {
127 if (me.isVisible()) {
129 me.doComponentLayout();
134 initAria: function() {
137 var selModel = this.getSelectionModel(),
138 mode = selModel.getSelectionMode(),
139 actionEl = this.getActionEl();
141 // TODO: subscribe to mode changes or allow the selModel to manipulate this attribute.
142 if (mode !== 'SINGLE') {
143 actionEl.dom.setAttribute('aria-multiselectable', true);
147 onDestroy: function() {
148 Ext.destroyMembers(this, 'pagingToolbar', 'listEl');