如何更新 Sencha Touch 中的嵌套列表/树存储? [英] How to update the Nested List/Tree Store in Sencha Touch?

查看:35
本文介绍了如何更新 Sencha Touch 中的嵌套列表/树存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个嵌套列表,必须根据用户在 Ext.Carousel 中选择的内容填充新数据.

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 works!

似乎文档和论坛没有答案,因为我已经搜索了 2-3 天.提前致谢.

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(); }; 
},

这篇关于如何更新 Sencha Touch 中的嵌套列表/树存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆