嵌套列表刷新

时间:2012-05-10 03:59:50

标签: sencha-touch extjs sencha-touch-2 nested-lists

任何人都知道如何刷新嵌套列表?

我正在创建一个列表。点击一个项目,它会加载一个嵌套列表。如果我在一个嵌套列表中遍历,然后点击另一个项目并返回到prev项目,它仍然停留在最后一个项目的位置。

我尝试使用

Ext.getCmp('nestedList').refresh();

但它似乎没有用。

下面是嵌套列表面板的代码。

Ext.define("InfoImage.view.nestedList", {
    extend:'Ext.NestedList',
    xtype:'nestedList',
    id:'nestedList',

    config:{
        fullscreen:'true',
        title:'Work Items Task 1',
       // ui:'normal',
        xtype:'nestedList',
        displayField : 'text',
        store:'nestedListStore',
        style: {
            'background-color': 'rgba(0,140,153,0.1)'
        }

    } 
});

和加载嵌套列表的代码是:

showListDetail : function(view, index, item, record) {
                        var rec = view.getStore().getAt(index);
                        // Ext.getStore('workItemStore').add({Task: '7'
                        // },{Server: 'mobcomp1'});
                        if (index == 0) {

                            this.getDocPanel().animateActiveItem(
                                    this.getNestedPanel(), {
                                        type : 'slide',
                                        direction : 'up',
                                        duration : 250
                                    });
                            Ext.getCmp('nestedList').reload();

                        }

感谢任何帮助。

提前致谢。

1 个答案:

答案 0 :(得分:1)

您无法直接刷新nestedlist。它没有refresh()reload()方法。

您需要做的只是load用于nestedlist使用配置proxy的商店。

 this.store.setProxy({
    // proxy configurations ...
    // ......
    // ......
 });
 this.store.load();