You need to sign in to do that
Don't have an account?
VSK98
I couldn't able to get the child rows by using onrowselection action in lightning:treegrid
Hi All,
I am displaying the list of records with tree structure using TREEGRID tag in lightning. When the user selects the parent record using a checkbox, I able to get the parent record details in JS controller but I didn't get child records.
As per my knowledge, the user didn't select the child records from UI, that why I couldn't get it.
IS IT POSSIBLE TO GET THE CHILD RECORDS WHEN THE USER SELECT THE PARENT RECORD FROM UI.
Adv Thanks......
Regards,
VSK98
I am displaying the list of records with tree structure using TREEGRID tag in lightning. When the user selects the parent record using a checkbox, I able to get the parent record details in JS controller but I didn't get child records.
Component: <lightning:treeGrid data="{!v.PaginationList}" columns="{!v.tablecolumns}" keyField="group_name" resizeColumnDisabled="false" onrowaction="{! c.handleRowAction }" onrowselection = "{!c.getSelectedName}"/>
JS Controller: getSelectedName: function(cmp, event, helper) { var selectedRows = event.getParam('selectedRows'); var name1 = ''; var city1 = ''; var street1= ''; var country1= ''; var CustomerId1 = ''; var Assetcnt1 = ''; var children1 = []; for (var i = 0; i < selectedRows.length; i++){ name1 = selectedRows[i].group_name; city1 = selectedRows[i].City; street1 = selectedRows[i].Street; country1 = selectedRows[i].Country; Assetcnt1 = selectedRows[i].Assetcnt; CustomerId1 = selectedRows[i].CustomerId; children1 = selectedRows[i]._children; // getting undefined }
As per my knowledge, the user didn't select the child records from UI, that why I couldn't get it.
IS IT POSSIBLE TO GET THE CHILD RECORDS WHEN THE USER SELECT THE PARENT RECORD FROM UI.
Adv Thanks......
Regards,
VSK98