PDA

View Full Version : PropertyGrid in 3.3 does not display complex values.



rickybobby
21 Dec 2010, 9:22 AM
So, we have been using PropertyGrids to display all sorts of data, including complex values like arrays and JSON objects. The display is handled by custom renderers and the editing by, you guessed it, custom editors. I am working on upgrading our applications from Ext 3.0.3 to 3.3.1. When I did so I noticed that our PropertyGrids were only displaying primitive values and the others were just gone, not appearing in the store even though they were included in the setSource() calls. After debugging I discovered why.



Ext.grid.PropertyStore
.
.
.
setSource : function(o){
this.source = o;
this.store.removeAll();
var data = [];
for(var k in o){
if(this.isEditableValue(o[k])){
data.push(new Ext.grid.PropertyRecord({name: k, value: o[k]}, k));
}
}
this.store.loadRecords({records: data}, {}, true);
},
// private
isEditableValue: function(val){
return Ext.isPrimitive(val) || Ext.isDate(val);
},


I don't know when isEditableValue was added, but why was this done? This severely limits the functionality of PropertyGrid for no reason at all. At the very least make it a config option to do this check or not. As it stands, I am forced to override the function in my code, which is a hassle and dangerous as it needs to be updated every time we "upgrade" the Ext version. And yes, I put upgrade in scare quotes intentionally as I have been very disappointed with the last several updates to ExtJS removing functionality, like this, for no particular reason, with no explanation, and with no notice.