PDA

View Full Version : Dynamic combobox loading



DJ JJ
18 Mar 2011, 12:05 PM
Hi! I created a form with two comboboxes. They are bounded to 2 different stores. The second combobox is dependent from the first: when I select a value in the first combobox, the second combobox should show a subset of all values. So, I thinked that I needed to apply a filter to the second store. So, after the blur on the first combo, I call a function:



validazione: function(){
if(this.typedb.getValue()=='MS Access')
var a=this.typeconn.getStore();
a.filter('tipoaccesso','ODBC');
this.typeconn.store.commitChanges();
}


this.typedb is the first combo; this.typeconn is the second. When I select 'MS Access' from the first combo, the code is executed, but the second combobox is not updated and there are old values. when I blur the second combo and reopen it, it is update. Is there an istruction for forcing the reload??

And, when I want to filter some result (e.g. tipoaccesso is ODBC and JDBC), how can I pass multiple values?