ExtJS 让grid里某行的checkbox不能选中

来源:互联网 发布:经纬度数据库 编辑:程序博客网 时间:2024/05/19 13:24

var sm = new Ext.grid.CheckboxSelectionModel({        dataIndex:"userId",        listeners:{'beforerowselect': function( SelectionModel, rowIndex, keepExisting,record ) {                  if(record.data.userId=='1'){ //管理员用户                       Ext.Msg.alert("提示信息","不能删除管理员!");                       return false; //不能进行选择                  }else{                       return true;                  }        }}});

也可以使用以下方法进行取消选中:

theGrid.getSelectionModel().deselectRow(rowNumber);

原创粉丝点击