<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
- <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
- <script type="text/javascript" src="../prettify/prettify.js"></script>
+ <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>
</head>
<body onload="prettyPrint(); highlight();">
- <pre class="prettyprint lang-js"><span id='Ext-grid-property-HeaderContainer-method-constructor'><span id='Ext-grid-property-HeaderContainer'>/**
-</span></span> * @class Ext.grid.property.HeaderContainer
+ <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',
// 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,
}]
}]);
},
+
+ getCellEditor: function(record){
+ return this.grid.getCellEditor(record, this);
+ },
// private
// Render a property name cell
// 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);
},