Artistan
25 Sep 2009, 1:37 PM
this is a MINOR change that will allow selection model config in the grid panel config rather than creating a selection model object.
I do this to limit everything to configs that can create larger objects.
// this to allow selection model config in the selModel or sm for GridPanel config...
Ext.override(Ext.grid.GridPanel, {
getSelectionModel : function(){
if(!this.selModel){
this.selModel = new Ext.grid.RowSelectionModel(
this.disableSelection ? {selectRow: Ext.emptyFn} : null);
} else if(!Ext.isFunction(this.selModel.on)) {
// build the selection model from this.selModel as the config
this.selModel = new Ext.grid.RowSelectionModel(this.selModel);
}
return this.selModel;
}
});
I do this to limit everything to configs that can create larger objects.
// this to allow selection model config in the selModel or sm for GridPanel config...
Ext.override(Ext.grid.GridPanel, {
getSelectionModel : function(){
if(!this.selModel){
this.selModel = new Ext.grid.RowSelectionModel(
this.disableSelection ? {selectRow: Ext.emptyFn} : null);
} else if(!Ext.isFunction(this.selModel.on)) {
// build the selection model from this.selModel as the config
this.selModel = new Ext.grid.RowSelectionModel(this.selModel);
}
return this.selModel;
}
});