PDA

View Full Version : Unwanted auto load



Ghurdyl
23 Aug 2011, 7:17 AM
Hello,

I am trying to have a tree grid that does not load at render time but later on ; like after clicking a button.

Sounds easy but can't achieve this. :((

If someone could let me know how to do this on the tree grid example in the doc I'd be thankful.

Tanks for any hint. :)

jay@moduscreate.com
23 Aug 2011, 12:51 PM
Just don't render the tree panel until you need it. Else, you can try to setup the tree panel with an empty store.

Ghurdyl
23 Aug 2011, 11:08 PM
Ok

So no any other way to prevent tree loading. :-?
I actually need to render it as the data request needs an information held by a checkbox item of the tree's toolbar menu. (and the checkbox is stateful, cannot anticipate it's value)

So, it's maybe not very elegant but I have listened for the store's beforeload event and I return false while it's not ready to load according to my needs.

ValterBorges
24 Aug 2011, 11:10 AM
You can swap out stores.

You can change the query parameters that get submitted to the proxy so that it loads empty / no results first time and on some event set different parameters and then load the store again.
function(b){var a=this.indexOf(b);if(a!=-1){this.splice(a,1)}return this}

ValterBorges
24 Aug 2011, 11:13 AM
If you set the store to autoLoad:false on a tree are you saying it's still loading?

If so I would consider this a bug, imho it should obey the store setting.

Ghurdyl
25 Aug 2011, 4:43 AM
Thanks for all those replies,

You can swap out stores.

If I don't define any store for the tree, it does not apreciate ant send me to hell


You can change the query parameters that get submitted to the proxy so that it loads empty / no results first time and on some event set different parameters and then load the store again.

Very bad idea, I think because the ajax query will be done and consumes resources for nothing.


If you set the store to autoLoad:false on a tree are you saying it's still loading?

setting autoload to false was the very first thing I tried, but it loads anyway.