Hi, previously we used use ultra web tree, save a particular node's id, and later used it. We did it the following way:
var currentNodeId;
function UltraWebTree1_NodeClick(treeId, nodeId, button) {
currentNodeId = nodeId;
}
function renameNode() { var treeInstance = igtree_getTreeById(UltraWebTreeClientID); var currentNode = treeInstance.getNodeById(currentNodeId); currentNode.edit(); }
So, we need to do the same thing for web data tree. (Client side, using javascript)
1. We need to store web data tree node's ID/ Key, or any unique value
2. Later we need to get the node from the webdatatree using that unique value.
So far, we are unable to do that. Any help would be appreciated. Thanks in advance...
Hi Guys,
If you are not actually going back to the server, you can simply save off the node itself. Off the tree object, there should be an _id property you can access. the node is available off the node click client event args as args.GetNode(). Let me know if this is insufficient.
regards,David Young
Saving node didnt work for me.
I need to save the node Id (or any unique data) at client (before it goes to server post back), and I need that node at endRequestHandler (after coming back from server post back). I also need the Node in other postbacks. Saving node doesnt work, the node object is null at endRequestHandler, or in other postbacks. Previously, with ultrawebtree, I saved this nodeId in a variable/ hidden text box, so that I could read it from it at the end request handler.
So, I still need the GetNodeById or something equivalent.
Regards
Andalib
Ok, using the address attribute worked.
This is how I worked:
First I got the unique address this way in the client (Node object is collected from click event's eventArgs earlier):
var nodeAddress = Node._address;
I stored the address at hidden textbox, then later I retrieved the node from the tree:
var Node = tree.getNode(nodeAddress);
And, this worked. Thanks.
Hi Andalib,
The tree does not seem to have a built in method. But that does not mean you can do something similar yourself. You'll either have to store a unique value on the Value property of each node and save that and then find the node recursively. Or you can store the node address and then find the node that way. Once you have a node, you should be able to get the address as node.get_element().getAttribute("adr"); This is a '.' delimitted string where each number is the index in the collection at that level. Then on the server or client, you can parse the string and find the node that way.
regards,
Dave