I have a Ext.grid.Panel
with a set of columns. This grid is filtered, and depending on the filter I would like to define an editor for a column.
My grid:
Ext.define('Mb.view.MyPanel', {
extend: 'Ext.grid.Panel',
columns: [
{text: 'Order #', dataIndex: 'id'},
{text: 'Action', dataIndex: 'type',
renderer: function(value){
if(value == 'BP') return Lang._('Veuillez choisir')
return ''
}
},
Now I would like to do something like:
var panel = Mb.app.getView('MyPanel');
if (condition == true) {
panel.getColumns[1].setEditor({
xtype: 'textfield',
...
})
}
Obviously the methods getColumns
and setEditor
do not exist. I therefore need another method to activate an editor on that column.
I didn't find a method to access the column definitions to modifiy them and to rerender the grid afterwards.
Can you give me a hint in which direction to search ? Thanks.
getEditor(record)
and return whatever a field a like for the row. But where do I need to define it ? As a config option of the column ? This also means that there can be different editors on a row basis, am I right ? – Faustofaustus