1. #1
    Sencha User
    Join Date
    May 2008
    Posts
    4
    Vote Rating
    0
    mntek is on a distinguished road

      0  

    Default Answered: ajax combobox

    Answered: ajax combobox


    Hello!I'm use two comboboxes, select value in first fire ajax store update in second. Update works good, but on second and more updates in second combobox appear loading panel, which not closed, like this:Screen Shot 2011-11-30 at 19.38.28.png

    extjs 4.0.7, code:
    Code:
    var languageStore = new Ext.data.Store({
        autoLoad: true,
        storeId: 'languagesStore',
        proxy: {
            type: 'ajax',
            url: 'languages.json.php',
            reader: {
                type: 'json',
                root: 'languages'
            }
        },
        fields: [{name: 'id', type: 'int'}, {name: 'name', type: 'string'}]
    });
    
    
    var languageCombobox = new Ext.form.ComboBox({
    	fieldLabel: 'Язык',
        id: 'language-combo',
      	store: languageStore,
        disabled: false,
        valueField: 'id',
        displayField: 'name',
        emptyText: 'Выберите страну…',
        editable: false,
        listeners:
        {
        	select:
        	{
        		fn: function(combo, value)
        		{
        			var cc = Ext.getCmp('country-combo');
        			cc.clearValue();
        			if (cc.isDisabled())
        				cc.setDisabled(false);
        			cc.getStore().load({params: {languageId: combo.getValue()}});
        		}
        	}
        }
    });
    
    
    var countryStore = new Ext.data.Store({
        storeId: 'countriesStore',
        proxy: {
            type: 'ajax',
            url: 'countries.json.php',
            reader: {
                type: 'json',
                root: 'countries'
            }
        },
        fields: [{name: 'id', type: 'int'}, {name: 'name', type: 'string'}]
    });
    
    
    var countryCombobox = new Ext.form.ComboBox({
    	fieldLabel: 'Страна',
       	id: 'country-combo',
       	store: countryStore,
        disabled: true,
        valueField: 'id',
        displayField: 'name',
        emptyText: 'Выберите страну…',
        queryMode: 'local',
        editable: false
    });
    Json answer look like this:
    Code:
    {"countries":[{"id":"1","name":"Great Britain"},{"id":"2","name":"USA"}],"total":2}
    Can I hide this loading panel?
    Last edited by mntek; 30 Nov 2011 at 7:58 AM. Reason: code format

  2. This bug has been fixed in the next release (4.1.0 beta)

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,577
    Answers
    3447
    Vote Rating
    814
    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


    This bug has been fixed in the next release (4.1.0 beta)
    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.

Thread Participants: 1

Tags for this Thread