如何在选择树状网格上的复选框时获取其他列值
How to get other column value on selecting a checkbox on a tree grid
我有一个树形网格,有两列持续时间和一个复选框列。
我想要的是当我 select / deselect 复选框时我应该得到 Duration 列值。
这是我试过的代码
但不知道如何访问持续时间值。
{
xtype: 'nacheckcolumn', //only display checkbox on leaf items(tasks)
header: 'N/A',
dataIndex: 'NA',
menuDisabled: true,
width: 60,
sortable: false,
editor: {
xtype: 'checkbox',
cls: 'x-grid-checkheader-editor'
},
listeners: {
'checkchange': function (column, recordIndex, checked) {
console.log(checked);
if(checked === true) {
}
}
}
}
从 recordIndex 获取记录:
var record = column.up('grid').getStore().getAt(recordIndex)
然后获取所需列的值:
var duration = record.get('duration')
一起 :
'checkchange': function (column, recordIndex, checked) {
console.log(checked);
if(checked === true) {
var record = column.up('grid').getStore().getAt(recordIndex),
duration = record.get('duration')
}
}
我有一个树形网格,有两列持续时间和一个复选框列。 我想要的是当我 select / deselect 复选框时我应该得到 Duration 列值。 这是我试过的代码 但不知道如何访问持续时间值。
{
xtype: 'nacheckcolumn', //only display checkbox on leaf items(tasks)
header: 'N/A',
dataIndex: 'NA',
menuDisabled: true,
width: 60,
sortable: false,
editor: {
xtype: 'checkbox',
cls: 'x-grid-checkheader-editor'
},
listeners: {
'checkchange': function (column, recordIndex, checked) {
console.log(checked);
if(checked === true) {
}
}
}
}
从 recordIndex 获取记录:
var record = column.up('grid').getStore().getAt(recordIndex)
然后获取所需列的值:
var duration = record.get('duration')
一起 :
'checkchange': function (column, recordIndex, checked) {
console.log(checked);
if(checked === true) {
var record = column.up('grid').getStore().getAt(recordIndex),
duration = record.get('duration')
}
}