PDA

View Full Version : About the load method in TreeStore of Ext.tree.Panel



feiq
30 Dec 2011, 5:21 AM
I want an effect that when I call the load method of treestore, and tree will refresh and load the data. It's normal for grid panel, but it seems to be so hard for tree panel.


I had a test on treegrid example, and I had some modification.
1) I add the following code for stopping autoLoad when rootVisible=false.


Ext.tree.View.override({
setRootNode : function(node) {
var me = this;
me.store.setNode(node);
me.node = node;
}
});

About the code, you can reference this thread (http://www.sencha.com/forum/showthread.php?136426-TreeStore-ignores-autoLoad-false).
2) Add the following code after "var tree=..." to load data.


store.load();

The data can be loaded normally, but the data won't be rendered into the treepanel.
And when I call rootNode.expaned(), the tree panel will work well.

Any body can help me? thx.

Farish
30 Dec 2011, 6:40 AM
try using
expanded: true in the root node config. The default value is false.

Regards,
Farish