1.EXT多选框多选时需要按住ctrl键,方法CheckboxSelectionModel,重写后选择是不需要按住ctrl键
<span style="font-size:18px;">Ext.override(Ext.grid.CheckboxSelectionModel, {
handleMouseDown : function(g, rowIndex, e){
if(e.button !== 0 || this.isLocked()){
return;
}
var view = this.grid.getView();
if(e.shiftKey && !this.singleSelect && this.last !== false){
var last = this.last;
this.selectRange(last, rowIndex, e.ctrlKey);
this.last = last; // reset the last
view.focusRow(rowIndex);
}else{
var isSelected = this.isSelected(rowIndex);
if(isSelected){
this.deselectRow(rowIndex);
}else if(!isSelected || this.getCount() > 1){
this.selectRow(rowIndex, true);
view.focusRow(rowIndex);
}
}
}
}); </span>
2.EXT多选框选择是需要点击数据行才可选中改行,修改后则点击多选框即可选中
修改前:点击位置
修改后:点击位置
修改代码:红色为添加代码
<span style="font-size:18px;">HostInterIOList = Ext.extend(Ext.app.GridSelect,{
showSaveButton : false,
initComponent : function(){
<span style="color:#ff0000;"><strong>var csm = new Ext.grid.CheckboxSelectionModel({singleSelect:false});</strong></span>
Ext.apply(this,{
cm:new Ext.grid.ColumnModel([
<span style="color:#ff0000;"><strong>csm,</strong></span>
{header: '序号',dataIndex:'sort'},
{header: '参数名称',dataIndex:'text',width: 150},
{header: '参数代码',dataIndex:'code'}
]),
title : '参数映射',
<strong><span style="color:#ff0000;">sm:csm,</span></strong>
storeMapping:[
'sort','text', 'code','checked'
],
url:ctx+'/tabChannelInter/getHostInterIOs'
});
HostInterIOList.superclass.initComponent.call(this);
}
});</span>