PDA

View Full Version : Help with concurrency strategy in a tree



jgwufgator1
21 Oct 2013, 6:24 AM
Hello,
I have a tree panel that is populated by an AJAX proxy. It is only two levels deep:
Root
First level contains folder and leaf nodes
Second level - only contains leaf nodes

The server only returns the first level on startup.

Here is my problem:
1. Two users are using this application simultaneously. First user creates a folder under the root and a leaf under the root.
2. The second user logs in and drags/drops the leaf under the root to the folder created by user 1.
3. The first user then expands the folder, and a request is made to fill the children. This user then sees the leaf node created in step 1 in both the root and as a child of the folder.

I was hoping to capture the nodes before they are saved in the store and remove identical nodes from the store before the new nodes are added to the store. I am not sure exactly where I can do this. It appears that the load event has already saved the new nodes to the store. Any hints on how I should handle this situation?

Thanks in advance.

jgwufgator1
21 Oct 2013, 9:37 AM
Alternatively, if I could load not only the node just expanded, the root node, and all other expanded nodes, that would work, too.