Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / docs / source / HeaderContainer.html
index f6713d4..91918ad 100644 (file)
@@ -1,16 +1,32 @@
-<!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-grid.property.HeaderContainer-method-constructor'><span id='Ext-grid.property.HeaderContainer'>/**
-</span></span> * @class Ext.grid.property.HeaderContainer
+<!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-grid-property-HeaderContainer'>/**
+</span> * @class Ext.grid.property.HeaderContainer
  * @extends Ext.grid.header.Container
  * A custom HeaderContainer for the {@link Ext.grid.property.Grid}.  Generally it should not need to be used directly.
- * @constructor
- * @param {Ext.grid.property.Grid} grid The grid this store will be bound to
- * @param {Object} source The source data config object
  */
 Ext.define('Ext.grid.property.HeaderContainer', {
 
     extend: 'Ext.grid.header.Container',
 
     alternateClassName: 'Ext.grid.PropertyColumnModel',
+    
+    nameWidth: 115,
 
     // private - strings used for locale support
     nameText : 'Name',
@@ -21,27 +37,31 @@ Ext.define('Ext.grid.property.HeaderContainer', {
 
     // private
     nameColumnCls: Ext.baseCSSPrefix + 'grid-property-name',
-    
-    constructor : function(grid, store) {
 
-        this.grid = grid;
-        this.store = store;
-        this.callParent([{
+<span id='Ext-grid-property-HeaderContainer-method-constructor'>    /**
+</span>     * Creates new HeaderContainer.
+     * @param {Ext.grid.property.Grid} grid The grid this store will be bound to
+     * @param {Object} source The source data config object
+     */
+    constructor : function(grid, store) {
+        var me = this;
+        
+        me.grid = grid;
+        me.store = store;
+        me.callParent([{
             items: [{
-                header: this.nameText,
-                width: 115,
+                header: me.nameText,
+                width: grid.nameColumnWidth || me.nameWidth,
                 sortable: true,
                 dataIndex: grid.nameField,
-                renderer: Ext.Function.bind(this.renderProp, this),
+                renderer: Ext.Function.bind(me.renderProp, me),
                 itemId: grid.nameField,
                 menuDisabled :true,
-                tdCls: this.nameColumnCls
+                tdCls: me.nameColumnCls
             }, {
-                header: this.valueText,
-                renderer: Ext.Function.bind(this.renderCell, this),
-                getEditor: function(record) {
-                    return grid.getCellEditor(record, this);
-                },
+                header: me.valueText,
+                renderer: Ext.Function.bind(me.renderCell, me),
+                getEditor: Ext.Function.bind(me.getCellEditor, me),
                 flex: 1,
                 fixed: true,
                 dataIndex: grid.valueField,
@@ -50,6 +70,10 @@ Ext.define('Ext.grid.property.HeaderContainer', {
             }]
         }]);
     },
+    
+    getCellEditor: function(record){
+        return this.grid.getCellEditor(record, this);
+    },
 
     // private
     // Render a property name cell
@@ -61,16 +85,16 @@ Ext.define('Ext.grid.property.HeaderContainer', {
     // Render a property value cell
     renderCell : function(val, meta, rec) {
         var me = this,
-            renderer = this.grid.customRenderers[rec.get(me.grid.nameField)],
+            renderer = me.grid.customRenderers[rec.get(me.grid.nameField)],
             result = val;
 
         if (renderer) {
-            return renderer.apply(this, arguments);
+            return renderer.apply(me, arguments);
         }
         if (Ext.isDate(val)) {
-            result = this.renderDate(val);
+            result = me.renderDate(val);
         } else if (Ext.isBoolean(val)) {
-            result = this.renderBool(val);
+            result = me.renderBool(val);
         }
         return Ext.util.Format.htmlEncode(result);
     },
@@ -89,4 +113,6 @@ Ext.define('Ext.grid.property.HeaderContainer', {
         var pn = this.grid.propertyNames;
         return pn &amp;&amp; pn[name] ? pn[name] : name;
     }
-});</pre></pre></body></html>
\ No newline at end of file
+});</pre>
+</body>
+</html>