david kanarek
18 Jan 2012, 12:42 PM
I'm using a Direct proxy to load my TreeStore. The problem is, while I return a complete tree, including the root with all of its properties, the TreeStore merely takes the children of the returned root and adds them to the TreeStore's existing root. Any other properties of the root node that were returned are lost.
I've found two ways to fix this:
1) Load an instance of the model used by the store, and create the store (using the loaded model instance as root) on the load's callback.
2) Load the model instance in the store's constructor, with a callback to setRootNode on the store and then invoke the real callback.
These both seem like very roundabout ways of doing what should be the natural function of the TreeStore's load.
Am I doing something wrong, or is this really the best way to load a full tree?
I've found two ways to fix this:
1) Load an instance of the model used by the store, and create the store (using the loaded model instance as root) on the load's callback.
2) Load the model instance in the store's constructor, with a callback to setRootNode on the store and then invoke the real callback.
These both seem like very roundabout ways of doing what should be the natural function of the TreeStore's load.
Am I doing something wrong, or is this really the best way to load a full tree?