I want to get the value of another column in the same row, in a renderer function of one column. I tried a method, but it didn't work. And here's my code:
columns: [
{id:'id',header: 'ID', width: 30, sortable: true, dataIndex: 'category_id'},
{header: 'current_level', width: 100, sortable: true, dataIndex: 'current_level'},
{header: 'complete_code', width: 100, sortable: true, dataIndex: 'complete_code'},
{header: 'parent_id', width: 100, sortable: true, dataIndex: 'parent_id'},
{header: 'parent_name', width: 100, sortable: true, dataIndex: 'parent_name'},
{
header: 'has_standards', width: 100, sortable: true, dataIndex: 'has_standards',
renderer: function(val, meta, record, rowIndex) {
if (val == 'Yes') {
console.log(record.data.category_id);
}
}
}
],
As you see, I want to get the category_id in the same row, in the renderer function of has_standards column. But my way is wrong. Could you tell me how to do it?
record.data.category_id
is correct. What is wrong? Is there any error? Isval == 'Yes'
correct? Can you post more code? – Lefebvre