Hi,
I am using igtree to add tree node dynamically.But i am not able to see the text of the newly created treenode.
This is my reference http://ko.infragistics.com/products/jquery/sample/tree/add-remove-node-api
To create tree i am using a model class
//modal class
public string Name { get; set; } public float Value { get; set; } public virtual List TreeNodes { get; set; }
//tree
@(Html. Infragistics(). Tree(). ID("MVCBoundTree"). SingleBranchExpand(true). Bindings( bindings => { bindings. TextKey("Name"). ValueKey("Value"). ChildDataProperty("TreeNodes"); }). DataSource(Model). DataBind(). Render() )
//adding node dynamically
$("#btnLevelCategory").click(function () { var selectedNode = $("#MVCBoundTree").igTree("selectedNode").element; var selectedPath = $("#MVCBoundTree").igTree("selectedNode").path; if (selectedNode != null) {
// Create new node var newNode = { Text: "My New Node", Value: Math.floor(Math.random() * 1001) }; // Add node to Tree $("#MVCBoundTree").igTree("addNode", newNode, selectedNode); // and expand node $("#MVCBoundTree").igTree("expand", selectedNode); } });
I can see a new item added , but the text is always coming as empty.Why is the text of new node coming as empty?
Regards,
Balu
Is this a bug in infragistics?
I read in the forum that Infragistics tree doesn't allow dynamic addition of tree.
Any update on this post?
Hello Balu,
Thank you for notifying us for this scenario.
I have created the following case for you: CAS-125988-C5S3L5 and will update you through it.
You can access it though the following link (once you are logged in our website): https://ko.infragistics.com/my-account/support-activity.
Let me know if you have any questions.