Alien-Web-ExtJS-V3
view release on metacpan or search on metacpan
share/docs/source/PropertyGrid.html view on Meta::CPAN
}else{
record.reject();
}
}
},
<span id='Ext-grid-PropertyStore-method-getProperty'> // private
</span> getProperty : function(row){
return this.store.getAt(row);
},
<span id='Ext-grid-PropertyStore-method-isEditableValue'> // private
</span> isEditableValue: function(val){
return Ext.isPrimitive(val) || Ext.isDate(val);
},
<span id='Ext-grid-PropertyStore-method-setValue'> // private
</span> setValue : function(prop, value, create){
var r = this.getRec(prop);
if(r){
r.set('value', value);
this.source[prop] = value;
}else if(create){
// only create if specified.
this.source[prop] = value;
r = new Ext.grid.PropertyRecord({name: prop, value: value}, prop);
this.store.add(r);
}
},
<span id='Ext-grid-PropertyStore-method-remove'> // private
</span> remove : function(prop){
var r = this.getRec(prop);
if(r){
this.store.remove(r);
delete this.source[prop];
}
},
<span id='Ext-grid-PropertyStore-method-getRec'> // private
</span> getRec : function(prop){
return this.store.getById(prop);
},
<span id='Ext-grid-PropertyStore-method-getSource'> // protected - should only be called by the grid. Use grid.getSource instead.
</span> getSource : function(){
return this.source;
}
});
<span id='Ext-grid-PropertyColumnModel-method-constructor'><span id='Ext-grid-PropertyColumnModel'>/**
</span></span> * @class Ext.grid.PropertyColumnModel
* @extends Ext.grid.ColumnModel
* A custom column model for the {@link Ext.grid.PropertyGrid}. Generally it should not need to be used directly.
* @constructor
* @param {Ext.grid.Grid} grid The grid this store will be bound to
* @param {Object} source The source data config object
*/
Ext.grid.PropertyColumnModel = Ext.extend(Ext.grid.ColumnModel, {
<span id='Ext-grid-PropertyColumnModel-property-nameText'> // private - strings used for locale support
</span> nameText : 'Name',
<span id='Ext-grid-PropertyColumnModel-property-valueText'> valueText : 'Value',
</span><span id='Ext-grid-PropertyColumnModel-property-dateFormat'> dateFormat : 'm/j/Y',
</span><span id='Ext-grid-PropertyColumnModel-property-trueText'> trueText: 'true',
</span><span id='Ext-grid-PropertyColumnModel-property-falseText'> falseText: 'false',
</span>
constructor : function(grid, store){
var g = Ext.grid,
f = Ext.form;
this.grid = grid;
g.PropertyColumnModel.superclass.constructor.call(this, [
{header: this.nameText, width:50, sortable: true, dataIndex:'name', id: 'name', menuDisabled:true},
{header: this.valueText, width:50, resizable:false, dataIndex: 'value', id: 'value', menuDisabled:true}
]);
this.store = store;
var bfield = new f.Field({
autoCreate: {tag: 'select', children: [
{tag: 'option', value: 'true', html: this.trueText},
{tag: 'option', value: 'false', html: this.falseText}
]},
getValue : function(){
return this.el.dom.value == 'true';
}
});
this.editors = {
'date' : new g.GridEditor(new f.DateField({selectOnFocus:true})),
'string' : new g.GridEditor(new f.TextField({selectOnFocus:true})),
'number' : new g.GridEditor(new f.NumberField({selectOnFocus:true, style:'text-align:left;'})),
'boolean' : new g.GridEditor(bfield, {
autoSize: 'both'
})
};
this.renderCellDelegate = this.renderCell.createDelegate(this);
this.renderPropDelegate = this.renderProp.createDelegate(this);
},
<span id='Ext-grid-PropertyColumnModel-method-renderDate'> // private
</span> renderDate : function(dateVal){
return dateVal.dateFormat(this.dateFormat);
},
<span id='Ext-grid-PropertyColumnModel-method-renderBool'> // private
</span> renderBool : function(bVal){
return this[bVal ? 'trueText' : 'falseText'];
},
<span id='Ext-grid-PropertyColumnModel-method-isCellEditable'> // private
</span> isCellEditable : function(colIndex, rowIndex){
return colIndex == 1;
},
<span id='Ext-grid-PropertyColumnModel-method-getRenderer'> // private
</span> getRenderer : function(col){
return col == 1 ?
this.renderCellDelegate : this.renderPropDelegate;
},
<span id='Ext-grid-PropertyColumnModel-method-renderProp'> // private
( run in 0.481 second using v1.01-cache-2.11-cpan-ceb78f64989 )