0

I have a store and dynamically change its URL.

store_form.proxy.conn.url=url;
store_form.load();
tabs.activate(1);

So if I change the URL, data in the store are going to change.

This store I load into FromPanel, which is located in a tab:

listeners: {
    'activate' :  function(zemform,records,options) {
        console.log("store:"+store_form.getAt(0));
        this.loaded = true;
        var record = store_form.getAt(0);
        zemform.getForm().loadRecord(record);
        //store_form.reload();
    }
},

But when the tab is opened, I see previous data. New data show only when I click on another tab and then click back. What's wrong with it?

4

1 回答 1

2

我不知道我是否正确理解您的问题,但我认为问题出在activate处理程序上。它只会在激活选项卡时触发。您写道,选项卡已经打开,因此它也被激活,activate在这种情况下不会触发事件。

取而代之的是,您应该调用loadRecord(record)存储load处理程序:http ://docs.sencha.com/ext-js/3-4/#!/api/Ext.data.Store-event-load

于 2012-11-28T12:54:28.980 回答