Hybrid View
-
12 Sep 2012 4:55 PM #1
How to trigger an event upon select of form.ComboBox?
How to trigger an event upon select of form.ComboBox?
Hi,
The form.ComboBox is very handy for autosuggest. Now, I'd like to take a step further, that is, upon selection, trigger another event such as submit the form. Is it doable with Ext 2.2? If so, how?
Thanks in advance.
-
12 Sep 2012 10:16 PM #2
HI!
i am wondering you have posted your thread in sencha touch 2.x forum and mentioned Ext 2.2 in description??
if you are using sencha touch, you may use selectfield instead of combo.
if you are using ExtJs 2.x versions...you may use select event for your combo(Fires when a list item is selected) and do whatever you want!
check this:-
http://docs.sencha.com/ext-js/2-3/#!...x-event-selectsword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.
-
13 Sep 2012 5:19 AM #3
oops, sorry wasn't paying enough attention about the forum name...
could you showed a sample of select use in relation to form.ComboBox?
like a select method similar to id or mode OR via listeners something?
many thanks.
-
13 Sep 2012 5:38 AM #4
Sample for you to attach select on your form.combobox:-
Code:name:'myCombo', listeners:{ select:function(cmb,rec,index){ // do whatever you want here } }sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.
-
13 Sep 2012 6:24 AM #5
Thank you for the sample code.
Here's what I added to the ComboBox interface, parallel in usage to id method, but code location-wise, right after the id method.
listeners:{
select:function(cmb,rec,index){
alert('action upon select');
document.forms[0].submit()}
},
// next, mode method
Outcome: no error msg, and yet it does not do anything, tested with Firefox 15 with Firebug on. What am I missing here?


Reply With Quote