0

I have a treepanel inside my form. The code is

{
xtype:'treepanel',
rootVisible:false,
hidden:true,
autoload:false,
store:{autoload:false,proxy:{type:'ajax',url:'../json/objectList.php?id='+id},root:{text:'Objects',id:'src',expanded:true}},
listeners:{
    show:function(){
        this.store.load();
    }
}
}

The problem is, I want to prevent loading before the tree is shown. But setting autoload to false does not have any effect. I still see a server request, even if the tree is hidden.

Jacobian
  • 10,122
  • 29
  • 128
  • 221

1 Answers1

1

The autoLoad property does not work for tree stores as the load is based on the expansion of the node as you are doing for root. This is what I do to overcome it.

In your store confing

root:{
    text:'Objects',
    id:'src',
    expanded:true,
    children:[]
}

Setting an empty children object will prevent the store load. Then all you need to do is set up a listener on the tree view to load the store as you have done. You will need to modify the server code to return the data without the children property...so just the array.

bakamike
  • 1,004
  • 2
  • 7
  • 11