Jul 28, 2009, 12:54 PM
Check empty store
I am using the below function to check for empty store - says records is null or not an object?
var hospitalsLoad = function(value, metadata, records, rowIndex, colIndex, store) {
if(!Ext.isEmpty(records) && records.length > 0){
Hospitals.setDisabled(false);
Hospitals.setValue(Hospitals.store.getAt(0).get('i d'));
}
else{
Hospitals.setDisabled(true);}
}
var hospitalsLoad = function(value, metadata, records, rowIndex, colIndex, store) {
if(!Ext.isEmpty(records) && records.length > 0){
Hospitals.setDisabled(false);
Hospitals.setValue(Hospitals.store.getAt(0).get('i d'));
}
else{
Hospitals.setDisabled(true);}
}