PDA

View Full Version : Load TreeStores through RPC services



cyChop
2 Mar 2011, 6:34 AM
Hi there,

I was writing a RPC service that generates a whole TreeStore on-the-go, and suddenly realized that TreeStore was not a serializable type. Thing is, I will not use it to represent a hierarchy of directories, but rather for something like:
- client
- contract
- detail

Since this is intended to display search results, I use a query with complex criteria and do not wish to run the service several times.

Do you people know of any way to generate the whole tree structure of the store in a single service and load it all when displaying the tree? Thanks in advance,

cyChop

(GXT 2.1)

cyChop
4 Mar 2011, 2:59 AM
OK, so I found a solution. For those that might be interested in the future:

Create a List<TreeModel> on the server, since these are serializable. You can pass them to the client, when all that's left is doing a store.add(myList, true);

See ya!