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-grid-property-HeaderContainer-method-constructor'><span id='Ext-grid-property-HeaderContainer'>/**
19 </span></span> * @class Ext.grid.property.HeaderContainer
20 * @extends Ext.grid.header.Container
21 * A custom HeaderContainer for the {@link Ext.grid.property.Grid}. Generally it should not need to be used directly.
23 * @param {Ext.grid.property.Grid} grid The grid this store will be bound to
24 * @param {Object} source The source data config object
26 Ext.define('Ext.grid.property.HeaderContainer', {
28 extend: 'Ext.grid.header.Container',
30 alternateClassName: 'Ext.grid.PropertyColumnModel',
32 // private - strings used for locale support
40 nameColumnCls: Ext.baseCSSPrefix + 'grid-property-name',
42 constructor : function(grid, store) {
48 header: this.nameText,
51 dataIndex: grid.nameField,
52 renderer: Ext.Function.bind(this.renderProp, this),
53 itemId: grid.nameField,
55 tdCls: this.nameColumnCls
57 header: this.valueText,
58 renderer: Ext.Function.bind(this.renderCell, this),
59 getEditor: function(record) {
60 return grid.getCellEditor(record, this);
64 dataIndex: grid.valueField,
65 itemId: grid.valueField,
72 // Render a property name cell
73 renderProp : function(v) {
74 return this.getPropertyName(v);
78 // Render a property value cell
79 renderCell : function(val, meta, rec) {
81 renderer = this.grid.customRenderers[rec.get(me.grid.nameField)],
85 return renderer.apply(this, arguments);
87 if (Ext.isDate(val)) {
88 result = this.renderDate(val);
89 } else if (Ext.isBoolean(val)) {
90 result = this.renderBool(val);
92 return Ext.util.Format.htmlEncode(result);
96 renderDate : Ext.util.Format.date,
99 renderBool : function(bVal) {
100 return this[bVal ? 'trueText' : 'falseText'];
104 // Renders custom property names instead of raw names if defined in the Grid
105 getPropertyName : function(name) {
106 var pn = this.grid.propertyNames;
107 return pn && pn[name] ? pn[name] : name;