1. #1
    Sencha User crocop21's Avatar
    Join Date
    May 2012
    Posts
    65
    Vote Rating
    0
    crocop21 is an unknown quantity at this point

      0  

    Default Answered: Nested Combobox

    Answered: Nested Combobox


    Hi all, i am try to implement a nested Combobox with extjs4 i have all right i think, but the problem is in my function when i try to load my store in the combo here is my error:

    records.get is not a function

    And here is mi code in my Controller:

    Code:
    onComboboxSelect: function(combo, records, options) {
             
            var form = Ext.getCmp('state');
            console.info(form);
    
    
            var store = form.getStore();
            form.enable();
            form.clearValue();
            store.load({params:{id: records.get('value')}});
              }
    Thanks..

  2. what about reload in extjs4?
    You can just use store.load()

    Scott.

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,635
    Answers
    613
    Vote Rating
    400
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Have you evaluated records to see if the object is valid? What are you using to debug?

    Scott.

  4. #3
    Sencha User crocop21's Avatar
    Join Date
    May 2012
    Posts
    65
    Vote Rating
    0
    crocop21 is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by scottmartin View Post
    Have you evaluated records to see if the object is valid? What are you using to debug?

    Scott.
    Yes the object is valid, firebug

  5. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,635
    Answers
    613
    Vote Rating
    400
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    records is array .. please try the following:

    Code:
    // The data store containing the list of states
    var states = Ext.create('Ext.data.Store', {
        fields: ['abbr', 'name'],
        data : [
            {"abbr":"AL", "name":"Alabama"},
            {"abbr":"AK", "name":"Alaska"},
            {"abbr":"AZ", "name":"Arizona"}
            //...
        ]
    });
    
    // Create the combo box, attached to the states data store
    Ext.create('Ext.form.ComboBox', {
        fieldLabel: 'Choose State',
        store: states,
        queryMode: 'local',
        displayField: 'name',
        valueField: 'abbr',
        renderTo: Ext.getBody(),
        listeners: {
            select: function(combo,records,opts) {
                console.log(records.data.name);
            }    
        }    
    });​
    Scott.

  6. #5
    Sencha User crocop21's Avatar
    Join Date
    May 2012
    Posts
    65
    Vote Rating
    0
    crocop21 is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by scottmartin View Post
    records is array .. please try the following:

    Code:
    // The data store containing the list of states
    var states = Ext.create('Ext.data.Store', {
        fields: ['abbr', 'name'],
        data : [
            {"abbr":"AL", "name":"Alabama"},
            {"abbr":"AK", "name":"Alaska"},
            {"abbr":"AZ", "name":"Arizona"}
            //...
        ]
    });
    
    // Create the combo box, attached to the states data store
    Ext.create('Ext.form.ComboBox', {
        fieldLabel: 'Choose State',
        store: states,
        queryMode: 'local',
        displayField: 'name',
        valueField: 'abbr',
        renderTo: Ext.getBody(),
        listeners: {
            select: function(combo,records,opts) {
                console.log(records.data.name);
            }    
        }    
    });​
    Scott.
    mmm but the question is how can reload the store for can load my state from my id who give me my country?

    i try form.getStore().load({params:{'id': comb.getValue('value')

    but is show me the countrys not the states

    12.jpg

  7. #6
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,635
    Answers
    613
    Vote Rating
    400
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Your original problem of records.get('value') has been solved?
    Now the issue is loading the secondary combo?

    When you make the call using store, is the correct information sent to the server and returned from the server?

    Scott.

  8. #7
    Sencha User crocop21's Avatar
    Join Date
    May 2012
    Posts
    65
    Vote Rating
    0
    crocop21 is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by scottmartin View Post
    Your original problem of records.get('value') has been solved?
    Now the issue is loading the secondary combo?

    When you make the call using store, is the correct information sent to the server and returned from the server?

    Scott.
    I think i solve with store.load({params :{id: comb.getValue()
    }});
    Because i send my id from my function.
    id 1
    limit 25
    page 1
    start 0
    for my php resolve the state with the id of the country, but i have a problem i think the store is not reload because is sending the same store only the countrys


    {"total":5,"data":[{"value":0,"label":"Argentina"},{"value":1,"label":"Espa\u00f1a"},
    {"value":2,"label":"M\u00e9xico"},{"value":3,"label":"Per\u00fa"},
    {"value":4,"label":"United States"}]}

    what about reload in extjs4?

  9. #8
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,635
    Answers
    613
    Vote Rating
    400
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      1  

    Default


    what about reload in extjs4?
    You can just use store.load()

    Scott.

  10. #9
    Sencha User crocop21's Avatar
    Join Date
    May 2012
    Posts
    65
    Vote Rating
    0
    crocop21 is an unknown quantity at this point

      0  

    Default


    Quote Originally Posted by scottmartin View Post
    You can just use store.load()

    Scott.
    Thanks Scott is working... Only i have a problem, when i reaload my store, my other combo countrys is reload too, i need reaload only the combo states..

    combostates.store.load({params :{id: comb.getValue()}});

  11. #10
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,635
    Answers
    613
    Vote Rating
    400
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Only the store you provide should load again
    Does each combo have it's own store?
    Is there any events that would cause the country store to load after a change of states store?

    Scott.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar