简体   繁体   English

更新/更改列表组件sencha touch的存储

[英]Update / change store of list component sencha touch

I have an overlay that has a toolbar as a dockedItem and a Ext.List as an item. 我有一个叠加层,该叠加层具有一个工具栏(作为ockedItem)和一个Ext.List(作为项目)。 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 overlay. 每张卡都有自己的存储区,其中包含我要在叠加层中显示的数据。

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(); 我试图在myList和Ext.StoreMgr.get('newsStore')。load()上调用doLayout(); 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. 调试时,我可以看到this.myList.store更改为所需的存储,但是视图没有更新。

I hope you can help me 我希望你能帮帮我

使用Ext.List的bindStore(cards [index] .store 方法可以正确地销毁并清除旧存储,并将新存储绑定到List的事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM