您的位置:首页 > Web前端 > JavaScript

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

2011-07-13 15:30 423 查看
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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: