X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..10a866c12701c0a0afd0ac85dcdcf32a421514ac:/docs/source/PropertyGrid.html
diff --git a/docs/source/PropertyGrid.html b/docs/source/PropertyGrid.html
index 0d8fd586..ef87278c 100644
--- a/docs/source/PropertyGrid.html
+++ b/docs/source/PropertyGrid.html
@@ -1,5 +1,6 @@
+
The source code
@@ -39,18 +40,20 @@ Ext.grid.PropertyRecord = Ext.data.Record.create([
* @param {Ext.grid.Grid} grid The grid this store will be bound to
* @param {Object} source The source data config object
*/
-Ext.grid.PropertyStore = function(grid, source){
- this.grid = grid;
- this.store = new Ext.data.Store({
- recordType : Ext.grid.PropertyRecord
- });
- this.store.on('update', this.onUpdate, this);
- if(source){
- this.setSource(source);
- }
- Ext.grid.PropertyStore.superclass.constructor.call(this);
-};
-Ext.extend(Ext.grid.PropertyStore, Ext.util.Observable, {
+Ext.grid.PropertyStore = Ext.extend(Ext.util.Observable, {
+
+ constructor : function(grid, source){
+ this.grid = grid;
+ this.store = new Ext.data.Store({
+ recordType : Ext.grid.PropertyRecord
+ });
+ this.store.on('update', this.onUpdate, this);
+ if(source){
+ this.setSource(source);
+ }
+ Ext.grid.PropertyStore.superclass.constructor.call(this);
+ },
+
// protected - should only be called by the grid. Use grid.setSource instead.
setSource : function(o){
this.source = o;
@@ -86,10 +89,7 @@ Ext.extend(Ext.grid.PropertyStore, Ext.util.Observable, {
// private
isEditableValue: function(val){
- if(Ext.isDate(val)){
- return true;
- }
- return !(Ext.isObject(val) || Ext.isFunction(val));
+ return Ext.isPrimitive(val) || Ext.isDate(val);
},
// private
@@ -112,41 +112,43 @@ Ext.extend(Ext.grid.PropertyStore, Ext.util.Observable, {
* @param {Ext.grid.Grid} grid The grid this store will be bound to
* @param {Object} source The source data config object
*/
-Ext.grid.PropertyColumnModel = 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: 'true'},
- {tag: 'option', value: 'false', html: 'false'}
- ]},
- getValue : function(){
- return this.el.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)
- };
- this.renderCellDelegate = this.renderCell.createDelegate(this);
- this.renderPropDelegate = this.renderProp.createDelegate(this);
-};
-
-Ext.extend(Ext.grid.PropertyColumnModel, Ext.grid.ColumnModel, {
+Ext.grid.PropertyColumnModel = Ext.extend(Ext.grid.ColumnModel, {
// private - strings used for locale support
nameText : 'Name',
valueText : 'Value',
dateFormat : 'm/j/Y',
+
+ 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: 'true'},
+ {tag: 'option', value: 'false', html: 'false'}
+ ]},
+ 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);
+ },
// private
renderDate : function(dateVal){
@@ -214,7 +216,7 @@ Ext.extend(Ext.grid.PropertyColumnModel, Ext.grid.ColumnModel, {
destroy : function(){
Ext.grid.PropertyColumnModel.superclass.destroy.call(this);
for(var ed in this.editors){
- Ext.destroy(ed);
+ Ext.destroy(this.editors[ed]);
}
}
});
@@ -367,6 +369,23 @@ grid.setSource({
getSource : function(){
return this.propStore.getSource();
}
+
+ /**
+ * @cfg store
+ * @hide
+ */
+ /**
+ * @cfg colModel
+ * @hide
+ */
+ /**
+ * @cfg cm
+ * @hide
+ */
+ /**
+ * @cfg columns
+ * @hide
+ */
});
Ext.reg("propertygrid", Ext.grid.PropertyGrid);