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');
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>'
79 me.pagingToolbar = me.createPagingToolbar();
84 Ext.applyIf(me.renderSelectors, {
89 createPagingToolbar: function() {
90 return Ext.widget('pagingtoolbar', {
91 pageSize: this.pageSize,
97 onRender: function() {
99 toolbar = me.pagingToolbar;
100 me.callParent(arguments);
102 toolbar.render(me.el);
106 bindStore : function(store, initial) {
108 toolbar = me.pagingToolbar;
109 me.callParent(arguments);
111 toolbar.bindStore(store, initial);
115 getTargetEl: function() {
116 return this.listEl || this.el;
119 getInnerTpl: function(displayField) {
120 return '{' + displayField + '}';
123 refresh: function() {
126 if (me.isVisible()) {
128 me.doComponentLayout();
133 initAria: function() {
136 var selModel = this.getSelectionModel(),
137 mode = selModel.getSelectionMode(),
138 actionEl = this.getActionEl();
140 // TODO: subscribe to mode changes or allow the selModel to manipulate this attribute.
141 if (mode !== 'SINGLE') {
142 actionEl.dom.setAttribute('aria-multiselectable', true);
146 onDestroy: function() {
147 Ext.destroyMembers(this, 'pagingToolbar', 'listEl');