Khush
Khush

Reputation: 877

Nested List refresh

Any one knows how to refresh a nested list?

I am creating a list. On tap of an item it loads a nested list. if i traverse in a nested list and then tap to another item and come back to the prev item, its still stuck in the place where it was last left.

I tried using

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

but thet doesn seem to work.

Below is my code for the nested list panel.

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)'
        }

    } 
});

and the code for loading the nested list is:

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

                        }

Any help is appreciated.

Thanks in advance.

Upvotes: 1

Views: 2068

Answers (1)

Saurabh Gokhale
Saurabh Gokhale

Reputation: 46425

You can't directly refresh a nestedlist. There's no refresh() or reload() method for it.

All you need to do is load the store which is used for your nestedlist using it's configured proxy.

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

Upvotes: 1

Related Questions