PDA

View Full Version : chnage combobox config from controller



sinaalizadeh
16 Feb 2015, 5:12 AM
I have a grid with combobox editor and I want to change its editable config at run time. Here is my code. The problem is that the change to the config takes place at the second click on the grid (one click behind). How can I control the config one level earlier?


'PropertyToDTWindow dtpropertylist: {
itemclick: this.doSelectPropertyGrid,
}


doSelectPropertyGrid: function(record, item, index, e, eOpts) {
var me = this;
var idProperty = item.get('idProperty');
me.getFormInitCombo().getStore().load({params: {idProperty: idProperty},
scope: this,
callback: function(records, operation, success) {
if (records.length < 2) {
Ext.apply(me.getFormInitCombo(), {editable: true});


}
}
})
}



{
xtype: 'gridcolumn',
dataIndex: 'initialValue',
editor: {
xtype: 'combobox',
name:'initCombo',
store: 'InitialValue',
displayField: 'value',
valueField: 'value',
queryMode: 'local',
allowBlank: true,
editable:false,
},

text: 'initial value',


}

yeghikyan
2 Mar 2015, 1:24 AM
beforeitemclick (http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.panel.Table-event-beforeitemclick)( this, record, item, index, e, eOpts )
Fires before the click event on an item is processed. Returns false to cancel the default action.