The example code to reproduce this problem:
(Paste in: http://www.smartclient.com/docs/10.0/a/system/reference/SmartClient_Explorer.html#jsonDataSource)
This is because the fields are not initialized yet. Why don't you simply initialize the fields in the init constructor of ListGrid like this?
This ensures the fields are set and these functions can be executed.
So, this example would work:
(Paste in: http://www.smartclient.com/docs/10.0/a/system/reference/SmartClient_Explorer.html#jsonDataSource)
Code:
isc.ListGrid.create({
ID: "countryList",
width:500, height:224, alternateRecordStyles:true, showAllRecords:true,
dataSource: countryDS,
autoFetchData: true
})
countryList.hideField('countryName');Code:
if (this.completeFields == null) this.setFields(this.fields);So, this example would work:
Code:
isc.ListGrid.addMethods({
init:function(){
this.Super('init',arguments);
if (this.completeFields == null) this.setFields(this.fields);
}
});
isc.ListGrid.create({
ID: "countryList",
width:500, height:224, alternateRecordStyles:true, showAllRecords:true,
dataSource: countryDS,
autoFetchData: true
})
countryList.hideField('countryName');