1. #1
    Sencha User
    Join Date
    Mar 2012
    Location
    Hyderabad
    Posts
    12
    Vote Rating
    0
    naseerkhan is on a distinguished road

      0  

    Default How to add a list to one select box based on another select box value

    How to add a list to one select box based on another select box value


    hi friends,
    This is naseer. I have a small problem i.e If i select a country in one select box then in next select box the states list has to be added dyanamically. Pls send me one simple example code regarding this issue.Its urgent for me.
    Pls .........

    Thanking u in advance. Don't fortget to send the code. Pls....................

    Thanks & Regards,
    NaseerKhan. P

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Basically what you need to do is when the first select field's change or select event is fired, get the second select field and load it's store. That's the first big step.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Location
    Hyderabad
    Posts
    12
    Vote Rating
    0
    naseerkhan is on a distinguished road

      0  

    Default


    yes but there must be different stores ex if u select india then the corresponding states has to be added to the second select box and if u select another country then its corresponding states has to be add to the second select box.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,327
    Vote Rating
    850
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Right. You just need to resolve the 2nd field and load the store.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Sencha User
    Join Date
    Mar 2012
    Location
    Hyderabad
    Posts
    12
    Vote Rating
    0
    naseerkhan is on a distinguished road

      0  

    Default


    Thank you very much for your valuable suggestions. I got the solution from the below link i.e

    http://www.swarmonline.com/2011/05/d...lected-values/

  6. #6
    Sencha User
    Join Date
    Feb 2012
    Posts
    11
    Vote Rating
    0
    lucas.mouilleron@me.com is on a distinguished road

      0  

    Default picker does not reload

    picker does not reload


    Hi,

    I am using 2 select fields in a similar way (though, each of my select field has its own store, and the second one is configured with getProxy(), anyway).

    Select 1 : stockList
    Select 2 : stock

    When i change 1, 2 is changing.
    But if i open the picker of 2, close it, and then change 1, and reopen 2, the datas in it are still from the last selection (but the visible item was from the new stockList selected).

    I think my picker 2 is not refreshed properly when displayed.

    Here is what i do on select 1
    Code:
    listeners:{		change: function(combo, value){ 
    		    select2.setPlaceHolder("loading stocks ...");
    		    var storeSelect2 = Ext.create('ts.store.select2store');
    		    storeSelect2.getProxy().select1ID = combo.getValue();
    		    select2.setStore(storeSelect2.load());
    		}
    	    }