Endless loading of an ajax store with 2 comboboxes

Go To StackoverFlow.com

0

I have two instances of the class AddressPanel on the panel.

Ext.define('AddressPanel', {
    extend: 'Ext.tab.Panel',
    initComponent: function() {
        this.items = [
            {
                title: 'Stations',
                itemId : 'pointStation',
                closable: false,
                items:[
                    {
                        xtype: 'combo',
                        fieldLabel: 'station',
                        store: stationStore,
                        queryMode: 'remote',
                        displayField: 'name',
                        valueField: 'id',
                        editable : false
                    }   

Both of them contain comboboxes that are associated with the same very basic store

var stationStore = Ext.create('Ext.data.Store', {
fields: ['id', 'name'],
proxy: {
    type: 'ajax',
    url : '/address/stationname'
}
});

I can open the combo from the first instance and choose a station.

Then I can open the combo from the second instance and choose another station.

It works fine.

But when I open the combobox from the first instance of AddressPanel again I get an endless loading.

How can I fix it?

Thank you in advance.

2012-04-04 18:21
by ysa


0

You could add an id to your combobox and when you go from the first instance to the second you can reset your combobox with

Ext.getCmp('id').reset();
2012-04-04 21:23
by fuzzyLikeSheep
fuzzyLikeSheep, the only place I use the combo is the select handler. I tries to insert reset() at the end of the handler. It does not help - ysa 2012-04-05 05:15


0

I made two copies of the store and set the store config of the the first combo to the first copy of the store and the store config of the second combo to the second copy.

It helps.

2012-04-07 11:45
by ysa
Ads