Added new node using the below code and not able to find a method to rename the user. Is there any way to rename added new node in the ignite tree ?
$("#firstTree").igTree("addNode", {Text: "New Node"}, selectedNode);
Hello Kavitha,
After investigating this further, I determined that the text of a node could be modified by using the “applyChangesToNode” method. Additionally the added node could be accessed by “findNodesByText”:
var node = $("#tree").igTree("findNodesByText", "New Node")[0].element;
$("#tree").igTree("applyChangesToNode", node, {Text: "New York"});
Below I am attaching a sample, demonstrating the described behavior. Please test it on your side and let me know if you need any further information regarding this matter.
Regards,
Monika Kirkova,
Infragistics
igTreeRenameNode.zip
Thank you I will try to add the method
Take your time in adding the method to your project and let me know if you need any further assistance.
Hi Monika,
I am trying to save the destination tree into JSON after dragging the files from source to destination. Chrome dev tools I can see data-path version 0.1 ,0.2 like that I was not sure what exactly that. Is there any method available to get the updated object because we need to feed the destination JSON file into another system?
I am glad that you find my suggestion helpful and were able to solve your issue.
Thank you for using Infragistics components.
Thank you for providing the solution. I tested on my side its working as expected.
If I understand right, your requirement is to get the updated data of the destination tree. This could be achieved by getting the id of the destination tree on nodeDropped event and accessing the data of this tree:
function dropNode(evt, ui) {
console.log(ui);
var id = ui.owner.element[0].id;
console.log(id);
var destinationTreeData = $("#" + id).igTree("option", "dataSource").settings.dataSource;
console.log(destinationTreeData);
}
Please test it on your side and let me know if you need any further information regarding this matter.
Provided drop node it's giving only dropped parent information. I need to retrieve whole tree.. Is there anyway to retrieve from parent element?. I want to retrieve from computer node to child-child node. Is there any method to retrieve whole noe information?.. Node dropped giving just parent-child information.
The updated data of the destination tree could be accessed by binding a method to the “nodeDropped” event and getting the ui.data property and the dragged element could be accessed by ui.draggable:
var data = ui.data;
var draggedElement = ui.draggable;
console.log(data);
console.log(draggedElement);
Below I am attaching the modified sample, demonstrating the described behavior. Please test it on your side and let me know if you need any further information regarding this matter.
1033.igTreeRenameNode.zip