X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/7a654f8d43fdb43d78b63d90528bed6e86b608cc..3789b528d8dd8aad4558e38e22d775bcab1cbd36:/docs/source/Container2.html diff --git a/docs/source/Container2.html b/docs/source/Container2.html index 82b08102..812ac75f 100644 --- a/docs/source/Container2.html +++ b/docs/source/Container2.html @@ -1,4 +1,21 @@ -Sencha Documentation Project
/**
+
+
+
+  
+  The source code
+  
+  
+  
+  
+
+
+  
/**
  * @class Ext.grid.header.Container
  * @extends Ext.container.Container
  * @private
@@ -28,14 +45,14 @@ Ext.define('Ext.grid.header.Container', {
     baseCls: Ext.baseCSSPrefix + 'grid-header-ct',
     dock: 'top',
 
-    /**
+    /**
      * @cfg {Number} weight
      * HeaderContainer overrides the default weight of 0 for all docked items to 100.
      * This is so that it has more priority over things like toolbars.
      */
     weight: 100,
     defaultType: 'gridcolumn',
-    /**
+    /**
      * @cfg {Number} defaultWidth
      * Width of the header if no width or flex is specified. Defaults to 100.
      */
@@ -58,13 +75,13 @@ Ext.define('Ext.grid.header.Container', {
 
     dragging: false,
 
-    /**
+    /**
      * <code>true</code> if this HeaderContainer is in fact a group header which contains sub headers.
      * @type Boolean
      * @property isGroupHeader
      */
 
-    /**
+    /**
      * @cfg {Boolean} sortable
      * Provides the default sortable state for all Headers within this HeaderContainer.
      * Also turns on or off the menus in the HeaderContainer. Note that the menu is
@@ -117,7 +134,7 @@ Ext.define('Ext.grid.header.Container', {
         });
         me.callParent();
         me.addEvents(
-            /**
+            /**
              * @event columnresize
              * @param {Ext.grid.header.Container} ct The grid's header Container which encapsulates all column headers.
              * @param {Ext.grid.column.Column} column The Column header Component which provides the column definition
@@ -125,7 +142,7 @@ Ext.define('Ext.grid.header.Container', {
              */
             'columnresize',
 
-            /**
+            /**
              * @event headerclick
              * @param {Ext.grid.header.Container} ct The grid's header Container which encapsulates all column headers.
              * @param {Ext.grid.column.Column} column The Column header Component which provides the column definition
@@ -134,7 +151,7 @@ Ext.define('Ext.grid.header.Container', {
              */
             'headerclick',
 
-            /**
+            /**
              * @event headertriggerclick
              * @param {Ext.grid.header.Container} ct The grid's header Container which encapsulates all column headers.
              * @param {Ext.grid.column.Column} column The Column header Component which provides the column definition
@@ -143,7 +160,7 @@ Ext.define('Ext.grid.header.Container', {
              */
             'headertriggerclick',
 
-            /**
+            /**
              * @event columnmove
              * @param {Ext.grid.header.Container} ct The grid's header Container which encapsulates all column headers.
              * @param {Ext.grid.column.Column} column The Column header Component which provides the column definition
@@ -151,26 +168,26 @@ Ext.define('Ext.grid.header.Container', {
              * @param {Number} toIdx
              */
             'columnmove',
-            /**
+            /**
              * @event columnhide
              * @param {Ext.grid.header.Container} ct The grid's header Container which encapsulates all column headers.
              * @param {Ext.grid.column.Column} column The Column header Component which provides the column definition
              */
             'columnhide',
-            /**
+            /**
              * @event columnshow
              * @param {Ext.grid.header.Container} ct The grid's header Container which encapsulates all column headers.
              * @param {Ext.grid.column.Column} column The Column header Component which provides the column definition
              */
             'columnshow',
-            /**
+            /**
              * @event sortchange
              * @param {Ext.grid.header.Container} ct The grid's header Container which encapsulates all column headers.
              * @param {Ext.grid.column.Column} column The Column header Component which provides the column definition
              * @param {String} direction
              */
             'sortchange',
-            /**
+            /**
              * @event menucreate
              * Fired immediately after the column header menu is created.
              * @param {Ext.grid.header.Container} ct This instance
@@ -356,7 +373,7 @@ Ext.define('Ext.grid.header.Container', {
         }
     },
 
-    /**
+    /**
      * Temporarily lock the headerCt. This makes it so that clicking on headers
      * don't trigger actions like sorting or opening of the header menu. This is
      * done because extraneous events may be fired on the headers after interacting
@@ -447,7 +464,7 @@ Ext.define('Ext.grid.header.Container', {
         me.fireEvent("columnmove", me, header, fromIdx, toIdx);
     },
 
-    /**
+    /**
      * Gets the menu (and will create it if it doesn't already exist)
      * @private
      */
@@ -468,7 +485,7 @@ Ext.define('Ext.grid.header.Container', {
         return me.menu;
     },
 
-    /**
+    /**
      * Returns an array of menu items to be placed into the shared menu
      * across all headers in this header container.
      * @returns {Array} menuItems
@@ -516,7 +533,7 @@ Ext.define('Ext.grid.header.Container', {
         activeHeader.setSortState('DESC');
     },
 
-    /**
+    /**
      * Returns an array of menu CheckItems corresponding to all immediate children of the passed Container which have been configured as hideable.
      */
     getColumnMenu: function(headerContainer) {
@@ -557,7 +574,7 @@ Ext.define('Ext.grid.header.Container', {
         header[checked ? 'show' : 'hide']();
     },
 
-    /**
+    /**
      * Get the columns used for generating a template via TableChunker.
      * Returns an array of all columns and their
      *  - dataIndex
@@ -589,7 +606,7 @@ Ext.define('Ext.grid.header.Container', {
         return cols;
     },
 
-    /**
+    /**
      * Returns the number of <b>grid columns</b> descended from this HeaderContainer.
      * Group Columns are HeaderContainers. All grid columns are returned, including hidden ones.
      */
@@ -597,7 +614,7 @@ Ext.define('Ext.grid.header.Container', {
         return this.getGridColumns().length;
     },
 
-    /**
+    /**
      * Gets the full width of all columns that are visible.
      */
     getFullWidth: function(flushCache) {
@@ -639,7 +656,7 @@ Ext.define('Ext.grid.header.Container', {
         }
     },
 
-    /**
+    /**
      * Returns an array of the <b>visible<b> columns in the grid. This goes down to the lowest column header
      * level, and does not return <i>grouped</i> headers which contain sub headers.
      * @param {Boolean} refreshCache If omitted, the cached set of columns will be returned. Pass true to refresh the cache.
@@ -649,7 +666,7 @@ Ext.define('Ext.grid.header.Container', {
         return Ext.ComponentQuery.query(':not([hidden])', this.getGridColumns(refreshCache));
     },
 
-    /**
+    /**
      * Returns an array of all columns which map to Store fields. This goes down to the lowest column header
      * level, and does not return <i>grouped</i> headers which contain sub headers.
      * @param {Boolean} refreshCache If omitted, the cached set of columns will be returned. Pass true to refresh the cache.
@@ -672,7 +689,7 @@ Ext.define('Ext.grid.header.Container', {
         return result;
     },
 
-    /**
+    /**
      * Get the index of a leaf level header regardless of what the nesting
      * structure is.
      */
@@ -681,7 +698,7 @@ Ext.define('Ext.grid.header.Container', {
         return Ext.Array.indexOf(columns, header);
     },
 
-    /**
+    /**
      * Get a leaf level header by index regardless of what the nesting
      * structure is.
      */
@@ -690,20 +707,22 @@ Ext.define('Ext.grid.header.Container', {
         return columns[index];
     },
 
-    /**
+    /**
      * Maps the record data to base it on the header id's.
      * This correlates to the markup/template generated by
      * TableChunker.
      */
-    prepareData: function(data, rowIdx, record, view) {
+    prepareData: function(data, rowIdx, record, view, panel) {
         var obj       = {},
-            headers   = this.getGridColumns(),
+            headers   = this.gridDataColumns || this.getGridColumns(),
             headersLn = headers.length,
             colIdx    = 0,
-            header, value,
+            header,
+            headerId,
+            renderer,
+            value,
             metaData,
-            g = this.up('tablepanel'),
-            store = g.store;
+            store = panel.store;
 
         for (; colIdx < headersLn; colIdx++) {
             metaData = {
@@ -711,16 +730,18 @@ Ext.define('Ext.grid.header.Container', {
                 style: ''
             };
             header = headers[colIdx];
+            headerId = header.id;
+            renderer = header.renderer;
             value = data[header.dataIndex];
 
             // When specifying a renderer as a string, it always resolves
             // to Ext.util.Format
-            if (Ext.isString(header.renderer)) {
-                header.renderer = Ext.util.Format[header.renderer];
+            if (typeof renderer === "string") {
+                header.renderer = renderer = Ext.util.Format[renderer];
             }
-
-            if (Ext.isFunction(header.renderer)) {
-                value = header.renderer.call(
+            
+            if (typeof renderer === "function") {
+                value = renderer.call(
                     header.scope || this.ownerCt,
                     value,
                     // metadata per cell passing an obj by reference so that
@@ -742,14 +763,15 @@ Ext.define('Ext.grid.header.Container', {
                 delete metaData.css;
             }
             // </debug>
-            obj[header.id+'-modified'] = record.isModified(header.dataIndex) ? Ext.baseCSSPrefix + 'grid-dirty-cell' : Ext.baseCSSPrefix + 'grid-clean-cell';
-            obj[header.id+'-tdCls'] = metaData.tdCls;
-            obj[header.id+'-tdAttr'] = metaData.tdAttr;
-            obj[header.id+'-style'] = metaData.style;
+            
+            obj[headerId+'-modified'] = record.modified[header.dataIndex] ? Ext.baseCSSPrefix + 'grid-dirty-cell' : Ext.baseCSSPrefix + 'grid-clean-cell';
+            obj[headerId+'-tdCls'] = metaData.tdCls;
+            obj[headerId+'-tdAttr'] = metaData.tdAttr;
+            obj[headerId+'-style'] = metaData.style;
             if (value === undefined || value === null || value === '') {
                 value = '&#160;';
             }
-            obj[header.id] = value;
+            obj[headerId] = value;
         }
         return obj;
     },
@@ -760,4 +782,6 @@ Ext.define('Ext.grid.header.Container', {
         }
     }
 });
-
\ No newline at end of file +
+ +