开发者

Update / change store of list component sencha touch

开发者 https://www.devze.com 2023-03-15 03:49 出处:网络
I have an overlay that has a toolbar as a dockedItem and a Ext.List as an item. This overlay is shown as the user drags the slider to show the important things in each card I have in a carousel. Each

I have an overlay that has a toolbar as a dockedItem and a Ext.List as an item. This overlay is shown as the user drags the slider to show the important things in each card I have in a carousel. Each card has its own store with data I want to show in the over开发者_运维知识库lay.

I am able to change the toolbar's title while I drag:

this.overlayTb.setTitle(cards[index].categoryName);

but when I try to change the store that feeds my list view, it does work.

this.myList.store = cards[index].store;

It just keeps showing the data of the initial store I set up instead of changing, like the toolbar title does. I have tried calling doLayout() on myList and Ext.StoreMgr.get('newsStore').load(); as suggested in this answer, but no good came out of that. And if I try:

this.myList.update();

it stops showing the data of the store, and I can only see a blank panel

While debugging, I can see that this.myList.store changes to the store I need, but the view is not updating.

I hope you can help me


Use the bindStore(cards[index].store) method of the Ext.List which properly destroys and cleans up after the old store and binds the new store to the List's events.

0

精彩评论

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