Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / docs / source / BoundList2.html
index 247b57d..588b00f 100644 (file)
@@ -1,7 +1,22 @@
-<!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-view.BoundList'>/**
-</span> * @class Ext.view.BoundList
- * @extends Ext.view.View
- * An internal used DataView for ComboBox, MultiSelect and ItemSelector.
+<!DOCTYPE html>
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <title>The source code</title>
+  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
+  <style type="text/css">
+    .highlight { display: block; background-color: #ddd; }
+  </style>
+  <script type="text/javascript">
+    function highlight() {
+      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
+    }
+  </script>
+</head>
+<body onload="prettyPrint(); highlight();">
+  <pre class="prettyprint lang-js"><span id='Ext-view-BoundList'>/**
+</span> * An internally used DataView for {@link Ext.form.field.ComboBox ComboBox}.
  */
 Ext.define('Ext.view.BoundList', {
     extend: 'Ext.view.View',
@@ -9,16 +24,16 @@ Ext.define('Ext.view.BoundList', {
     alternateClassName: 'Ext.BoundList',
     requires: ['Ext.layout.component.BoundList', 'Ext.toolbar.Paging'],
 
-<span id='Ext-view.BoundList-cfg-pageSize'>    /**
-</span>     * @cfg {Number} pageSize If greater than &lt;tt&gt;0&lt;/tt&gt;, a {@link Ext.toolbar.Paging} is displayed at the
-     * bottom of the list and store queries will execute with page start and
-     * {@link Ext.toolbar.Paging#pageSize limit} parameters.
+<span id='Ext-view-BoundList-cfg-pageSize'>    /**
+</span>     * @cfg {Number} pageSize
+     * If greater than `0`, a {@link Ext.toolbar.Paging} is displayed at the bottom of the list and store
+     * queries will execute with page {@link Ext.data.Operation#start start} and
+     * {@link Ext.data.Operation#limit limit} parameters. Defaults to `0`.
      */
     pageSize: 0,
 
-<span id='Ext-view.BoundList-property-pagingToolbar'>    /**
-</span>     * @property pagingToolbar
-     * @type {Ext.toolbar.Paging}
+<span id='Ext-view-BoundList-property-pagingToolbar'>    /**
+</span>     * @property {Ext.toolbar.Paging} pagingToolbar
      * A reference to the PagingToolbar instance in this view. Only populated if {@link #pageSize} is greater
      * than zero and the BoundList has been rendered.
      */
@@ -26,6 +41,7 @@ Ext.define('Ext.view.BoundList', {
     // private overrides
     autoScroll: true,
     baseCls: Ext.baseCSSPrefix + 'boundlist',
+    itemCls: Ext.baseCSSPrefix + 'boundlist-item',
     listItemCls: '',
     shadow: false,
     trackOver: true,
@@ -35,13 +51,13 @@ Ext.define('Ext.view.BoundList', {
 
     componentLayout: 'boundlist',
 
-    renderTpl: ['&lt;div class=&quot;list-ct&quot;&gt;&lt;/div&gt;'],
+    renderTpl: ['&lt;div id=&quot;{id}-listEl&quot; class=&quot;list-ct&quot;&gt;&lt;/div&gt;'],
 
     initComponent: function() {
         var me = this,
             baseCls = me.baseCls,
-            itemCls = baseCls + '-item';
-        me.itemCls = itemCls;
+            itemCls = me.itemCls;
+            
         me.selectedItemCls = baseCls + '-selected';
         me.overItemCls = baseCls + '-item-over';
         me.itemSelector = &quot;.&quot; + itemCls;
@@ -50,13 +66,17 @@ Ext.define('Ext.view.BoundList', {
             me.addCls(baseCls + '-floating');
         }
 
-        // should be setting aria-posinset based on entire set of data
-        // not filtered set
-        me.tpl = Ext.create('Ext.XTemplate', 
-            '&lt;ul&gt;&lt;tpl for=&quot;.&quot;&gt;',
-                '&lt;li role=&quot;option&quot; class=&quot;' + itemCls + '&quot;&gt;' + me.getInnerTpl(me.displayField) + '&lt;/li&gt;',
-            '&lt;/tpl&gt;&lt;/ul&gt;'
-        );
+        if (!me.tpl) {
+            // should be setting aria-posinset based on entire set of data
+            // not filtered set
+            me.tpl = Ext.create('Ext.XTemplate',
+                '&lt;ul&gt;&lt;tpl for=&quot;.&quot;&gt;',
+                    '&lt;li role=&quot;option&quot; class=&quot;' + itemCls + '&quot;&gt;' + me.getInnerTpl(me.displayField) + '&lt;/li&gt;',
+                '&lt;/tpl&gt;&lt;/ul&gt;'
+            );
+        } else if (Ext.isString(me.tpl)) {
+            me.tpl = Ext.create('Ext.XTemplate', me.tpl);
+        }
 
         if (me.pageSize) {
             me.pagingToolbar = me.createPagingToolbar();
@@ -64,9 +84,7 @@ Ext.define('Ext.view.BoundList', {
 
         me.callParent();
 
-        Ext.applyIf(me.renderSelectors, {
-            listEl: '.list-ct'
-        });
+        me.addChildEls('listEl');
     },
 
     createPagingToolbar: function() {
@@ -112,14 +130,14 @@ Ext.define('Ext.view.BoundList', {
             me.refreshed--;
         }
     },
-    
+
     initAria: function() {
         this.callParent();
-        
+
         var selModel = this.getSelectionModel(),
             mode     = selModel.getSelectionMode(),
             actionEl = this.getActionEl();
-        
+
         // TODO: subscribe to mode changes or allow the selModel to manipulate this attribute.
         if (mode !== 'SINGLE') {
             actionEl.dom.setAttribute('aria-multiselectable', true);
@@ -131,4 +149,6 @@ Ext.define('Ext.view.BoundList', {
         this.callParent();
     }
 });
-</pre></pre></body></html>
\ No newline at end of file
+</pre>
+</body>
+</html>