Topic: Problem with toggle
Good Evening,
I have got currently a problem with the toggle function.
I have got a client server application. The server shall memorize the state of the tree, that means which node is open and which is not.
When the user toggles a node, i post to the server which node has been toggled like this:
.addEvent('toggle',function(node, state){
treeRequestPut(
'../Toggle.do',
{ 'catchWordID' : node.data.catchWordID}
);When I now request a new tree from the server I get a right Json String back from the server. The JsonString includes the nodes which are open:
"property":{"name":"Test"},
"data":{"catchWordID":"1"},"state":{ "open":true }.
I get the json from a certain url and I call this url from the load function like this:
.load({
url: "../GetJson.do
})Right to this moment, evertythig is okay, so no problem.
The problem is now when i load the new jsonString in the load function that he always calls the toggle function again for every open node!
That's the reason why i get wrong states for the nodes on the server.
Is there a chance to prevent that he always calls the toggle function from the beginning??
Please apoligize for my bad english,
when anything is unclear or if you want to see my whole code please tell me.
I really need some help beacause I really need to solve this problem.
Best Jonathan