I have a grid panel in ExtJS 6.5 with more combo. When I select a value from a combo in the first column, I want to set, let's say hidden or disabled property, for the combo in the last column and the same row. I tried but it works for all combo from the last column not just for combo from the same row. Here is fiddle. Thanks!
Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
viewModel: {
data: {
index1: ''
}
},
columns: [
{
header: 'Hungry1',
dataIndex: 'h1',
flex: 1,
renderer: function(v) {
var iconCls = Ext.getStore('hungryStore').findRecord('value', v).get('iconCls');
return '<div class="x-fa ' + iconCls + '"></div>';
},
editor: {
xtype: 'combo',
editable: false,
fieldStyle: 'font-family: FontAwesome;',
tpl: [
'<tpl for=".">',
'<div class="x-boundlist-item x-fa {iconCls}"></div>',
'</tpl>'
],
queryMode: 'local',
store: Ext.data.StoreManager.lookup('hungryStore'),
valueField: 'value',
displayField: 'glyph',
listeners:{
select: function(combo, record){
combo.up('gridpanel').viewModel.data.index1 = combo.up().grid.selModel.selection.rowIdx;
// here I want to get combo from last column and same row index and set it hidden
}
}
}
}, {
header: 'Hungry',
dataIndex: 'hungry',
flex: 1,
renderer: function(v) {
var iconCls = Ext.getStore('hungryStore').findRecord('value', v).get('iconCls');
return '<div class="x-fa ' + iconCls + '"></div>';
},
editor: {
xtype: 'combo',
editable: false,
fieldStyle: 'font-family: FontAwesome;',
tpl: [
'<tpl for=".">',
'<div class="x-boundlist-item x-fa {iconCls}"></div>',
'</tpl>'
],
queryMode: 'local',
store: Ext.data.StoreManager.lookup('hungryStore'),
valueField: 'value',
displayField: 'glyph',
//hidden: '{isHidden}'
},
}
],
selModel: 'cellmodel',
plugins: {
ptype: 'cellediting',
clicksToEdit: 1
},
height: 400,
width: 600,
renderTo: Ext.getBody()
});