开发者

After loading extjs data store with data, setting the title of the toolbar doesn't work

开发者 https://www.devze.com 2023-04-04 12:11 出处:网络
I have a button with this handler: handler:function(){ myapp.functions.createDealerList(); myapp.mainPanel.setActiveItem(myapp.cards.dealerList, { type: \'slide\', direction: \'left\'});

I have a button with this handler:

handler:function(){
            myapp.functions.createDealerList();
            myapp.mainPanel.setActiveItem(myapp.cards.dealerList, { type: 'slide', direction: 'left'});
            myapp.toolbars.dealerListNav.setTitle("Page 1 of " + myapp.stores.dealerList.data.items[0].data.pageTotal);
            }

createDealerList create an extjs list and populates it with my json echoed data (by using the load() property on my data store). I then try to set the title of the toolbar. When I click the button the list is rendered with the loaded data but the title on the toolbar isn't set.

On the the card with this list I have another button next page which updates the list and also sets the title of the toolbar, the code is:

myapp.toolbars.dealerListNav.setTitle("Page " +sendpage+ " of " + myapp.stores.dealerList.data.items[0].data.pageTotal);

And that works! So I wonder what is going wrong here?

Tha开发者_如何学编程nks


Answer: use callback function with load method.

0

精彩评论

暂无评论...
验证码 换一张
取 消