PDA

View Full Version : Combobox Select event



volty
22 Feb 2012, 9:27 AM
Hi !

I've a problem with combobox select event [Ext4] which doesn't fire when you select the same item a second time. I need to reload a data store even the same value is selected.
This functionality was working with Ext 3

How can i resolve this problem

Thanks

friend
22 Feb 2012, 11:01 AM
I haven't tried this, but you might be able to use the 'beforeselect' event. In this event, you could query the combo for any currently selected item. If there is already a selected item, then compare it with what get's passed to the beforeselect event (record or index parameters).

If the records/indices match, then call your reload/refresh code.

foobarr
22 Feb 2012, 11:09 AM
You can get all click events from the box's underlying list:


var box = Ext.create('Ext.form.field.ComboBox', {
...
listConfig : {
listeners : {
'itemclick' : {
fn : function(dataViewModel, rec) {
console.log("list click event");
},
},
},
},
listeners : {
'select' : {
fn : function(box) {
console.log("box select event");
},
},
},
});


Hope that helps.

volty
23 Feb 2012, 3:04 AM
Great for listconfig solution it works fine !
For information, the beforeselect event fire a second time only if the combox lost the focus when you click outside for instance