View Full Version : Combobox editor in grid on first click the value is undefined

10 Feb 2011, 8:57 AM
Hi ,

Can somebody help me with the next issue: I want that on cell click the value of the editor to be shown in combobox, not to be cleared as is now which happens only on first click, till editor.value has the first value (before this is undefined), once is assigned the first value, on cell click the value is not cleared . Here's the code:

dataIndex: 'rbtime', header: 'Hours', width: 55, renderer: renderTime,
editor: {
xtype: 'timefield',
minValue: '00:00',
maxValue: '23:00',
format: 'H:i',
lazyRender: true


10 Feb 2011, 12:40 PM
It's a combo loading the store _after_ the combo has had it's 'setValue' called?

Yeah, go take this override (http://ww.extjs.com/learn/Ext_FAQ_ComboBox#Form_submits_displayField_instead_of_valueField).

10 Feb 2011, 11:51 PM
Hi, thanks for your replay
No, the problem is that on first click the value is cleared and instead of showing the value(as in picture) is showed the cursor(as in picture of the thread above). After first click it's ok. The "timefield" is in grid, and its mode: 'local', first time its value comes from grid store, after first click the value is assigned in editor's value variable and as I said it's ok. Hope I expressed myself cleared. Anyway your override have suggested some ideas by using its event.

11 Feb 2011, 12:04 AM
I just changed the override of Ext.form.Combobox to Ext.form.TimeField and worked. In debug, I noticed that the lines:

var text = v;
Ext.form.TimeField.superclass.setValue.call(this, text);
this.value = v;
did the trick. Trying to understand what and how.