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.
精彩评论