我需要使用复选框模型中的行单击与标题复选框。请告诉我该怎么办
无需使用行点击。
我已更改selModel并且不需要为点选复选框进行排列点击。 ExtJs直接属性检查行单击或复选框单击复选框。
click to see for demo on fiddle for testing. it is working fine.
var store = Ext.create('Ext.data.Store', {
fields: ['name', 'email', 'phone'],
data: [{
name: 'Lisa',
email: '[email protected]',
phone: '555-111-1224'
}, {
name: 'Bart',
email: '[email protected]',
phone: '555-222-1234'
}, {
name: 'Homer',
email: '[email protected]',
phone: '555-222-1244'
}, {
name: 'Marge',
email: '[email protected]',
phone: '555-222-1254'
}]
});
Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: store,
columns: [{
text: 'Name',
dataIndex: 'name'
}, {
text: 'Email',
dataIndex: 'email',
flex: 1
}, {
text: 'Phone',
dataIndex: 'phone'
}],
height: 200,
width: 400,
renderTo: Ext.getBody(),
selModel: {
checkOnly: false,
injectCheckbox: 'last',
mode: 'SIMPLE'
},
selType: 'checkboxmodel'
});
我真的不理解你的代码。当你基本上模仿checkOnly:false行为时,你为什么要设置'checkOnly:true'。 –
嗨伊万,我不想取消选择所有行,这就是为什么我使用'checkOnly:true'属性,我的其他混乱是为什么它有两个不同的行为在两个不同的版本相同的代码 – Avee