Hi,
I am currently working Treegrid component in Angular. I am using self-referential Data as shown below:
data sample:
{ "ID": 12345, "Name": "H111007", "NodeType": "project", "status":" approved " },
{ "ID":1696301, "PID":12345, "Name": "PM002", "NodeType": "Package1" },
{ "ID":1696331, "PID":12345, "status":" approved " ,"Name": "PM007", "NodeType": "Package2" },
{ "ID":1696340, "PID":12345,"status":" not-approved ", "Name": "PM012", "NodeType": "Package3" },
I have used template for displaying first column and the second column is commond column with two buttons one for context menu and one for Add record.
I need to add record on clicking of Add button by providing data from external application code and need to call a separate method in which I have to addrecord with the data provided
and need to see in the treegrid.
This data must pick ID from the row-data on which we have clicked and consume it as ID for the new-data.
I have tried adding it as attached files:
Query1:
How can I get the selected row data on click of button on each row, currently on page refresh if I click on any of the add button.
I am getting empty array for treeobj.getSeletectedRows() and the node is getting added at the index 0.
but if I select a row first and then click on add button then the node is added below it.
Query2:
PFA the code and let me know how can I solve this issue I need to have the added node as a child hierarchy and the parent should get expand icon next to it.
right now if the editsetting mode is batch and 'newRowPosition' is child but the node is not getting added as a child jus getting added below it but not with hierarchy.
Query3:
how can we stop expanding the complete view before rendering I have only one root node I need to expand only that and not its child or grandchild while rendering at starting.
PFB for the view:
On first click on 3rd row the row is added at top
But on second click on 3rd row the row is added below, but I need it as a child of that particular node.
Kindly Let me know how to proceed further for my requirement.
Regards,
Pooja K
Attachment:
AddItemTreegrid_fb0655ce.zip