วิธีรับค่าคอลัมน์อื่นในการเลือกช่องทำเครื่องหมายบนตารางแผนผัง

ฉันมีตารางแบบต้นไม้และมีสองคอลัมน์ Duration และคอลัมน์ช่องทำเครื่องหมาย สิ่งที่ฉันต้องการคือเมื่อฉันเลือก / ยกเลิกการเลือกช่องทำเครื่องหมาย ฉันควรได้รับค่าคอลัมน์ระยะเวลา นี่คือรหัสที่ฉันได้ลองแล้ว แต่ไม่รู้ว่าฉันจะเข้าถึงค่า 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) {
            }
        }
    }                                
}

person Mukta Chourishi    schedule 20.07.2015    source แหล่งที่มา


คำตอบ (1)


รับบันทึกจาก 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') 
    }
} 
person Lorenz Meyer    schedule 21.07.2015