Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reload TreeStore?

I have nestedlist with treestore. While loading first time the store is loaded perfectly and list is being displayed according to the store. When i click refresh button , my treestore should get reloaded with new data (with same data model as the first time) and nested list also need to be reloaded with new set of data.

Below is my treestore definition

rightPaneStoreData = getFolderListData();

rightPaneStore =new Ext.data.TreeStore({

   autoLoad:false,

   model: 'FIMT.models.rightPaneModel',

   root: rightPaneStoreData,
   proxy: {

   type: 'memory',

   reader: {

       type: 'tree',
       root: 'items'
       }

   },
   listeners: {
       datachanged: function(records){
           alert("datachanged");
           }
   }

   });

rightPaneStore.load();

In Ext.data.JsonStore i have accomplished the same using store.loaddata() method. But i couldnt find loaddata() method for TreeStore.

Kindly help me.

like image 733
shatthi Avatar asked Aug 23 '11 13:08

shatthi


1 Answers

This is working for me. I'm using MVC and this code is called in my controller.

treeStore.getRootNode().removeAll();
treeStore.load();
like image 70
Aris Bartee Avatar answered Oct 07 '22 10:10

Aris Bartee