//#########################################################################//
//获得选中行
//@params:grid--> the variable of your GridPanel or the id of your GridPanel
//@return:cRow--> the selected record
//@return:false-->no select or no data
function getSelectRow(grid){
var store;
var selModel;
if($.type(grid)=="object"){//judge the grid is Object or string ,Object is variable,string is id.
store = grid.getStore();
selModel = grid.getSelectionModel();
}else{
store = Ext.getCmp(grid).getStore();
selModel = Ext.getCmp(grid).getSelectionModel();
}
if(store.getCount()>0){
if(selModel.hasSelection()) { //whether selected
return selModel.getSelected();
}else
return false;
}else{
return false;
}
}
The handler of Ext.grid.GridPanel
最新推荐文章于 2020-12-23 09:34:39 发布