-
13 Feb 2010 8:59 AM #1
combobox beforeselect
combobox beforeselect
Hi all,
it seems that the beforeselect event of a combobox fires before the select event but the select event does not wait the beforeselect handler has returned.. it simply fire immediately after.
There's a way to fire the select event only after the beforeselect handler has finished?
Thanks a lot,
Antonio
-
16 Feb 2010 3:29 AM #2
Hello Antonio,
I've been having the same problem with comboboxes, and have not yet found a solution. It seem that the SQLiteStore ignores this, as far as I can tell, but it shouldn't as its just an extension of Ext.data.Store.
Anybody can comment on this?
Jack
-
16 Feb 2010 4:54 AM #3
Hi!
It's hard to understand.
Can you give some example code, please?Programming today is a race between software engineers striving to build bigger and better Ń–diot-proof programs, and the universe striving to produce bigger and better idiots. So far, the universe is winning. (Rick Cook)
Enhanced ExtJS adapter for Adobe AIR
-
12 Oct 2011 1:23 AM #4
here is the solution to add the event 'beforeselect'
here is the solution to add the event 'beforeselect'
Code:Ext.override(Ext.form.ComboBox, { onListSelectionChange: function(list, selectedRecords) { var me = this; // Only react to selection if it is not called from setValue, and if our list is // expanded (ignores changes to the selection model triggered elsewhere) if (!me.ignoreSelection && me.isExpanded) { var allowSelect = true; var lastSelectedRecord = me.picker.getSelectionModel().lastSelected; if (lastSelectedRecord != undefined) allowSelect = me.fireEvent('beforeselect', me, lastSelectedRecord) !== false; if(allowSelect) { if (!me.multiSelect) { Ext.defer(me.collapse, 1, me); } me.setValue(selectedRecords, false); if (selectedRecords.length > 0) { me.fireEvent('select', me, selectedRecords); } me.inputEl.focus(); } else { me.picker.getSelectionModel().deselect(lastSelectedRecord); } } } });


Reply With Quote