开发者

How to update the Nested List/Tree Store in Sencha Touch?

I have a nested list which must be filled with new data based on what does user select in an Ext.Carousel.

TreeStore.load(newData) // this does not work :(
TreeStore.removeAll() // this work开发者_如何学Pythons!

It seems that the docs and the forum don't have the answer, cause I have been searching for 2-3 days. Thank you in advance.


I've ended up with following solution:

NestedList = Ext.extend(Ext.NestedList, {
    loadData: function(data) {
        this.store.setProxy({
            type:'memory',
            data: data,
            reader: {
                type: 'tree',
                root: 'items'
            }
        });
        this.store.load();
        { // some back taps to make it show the top level
            this.onBackTap();         
            this.onBackTap();         
            this.onBackTap(); }; 
},


I believe you are correct. To load new data, try this:

TreeStore.removeAll();
TreeStore.add(newData);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜