You need to sign in to do that
Don't have an account?
Nidhi Sharma 144
lightning:treegrid find Id/data of deselected row
Hi,
I am working with a lightning:treegrid component.
The onrowselection attribute of lightning:treegrid invokes a method on js controller whenever a row is selected/deselected.
I am able to fetch the currently selected rows using the getSelectedRows() method.
But if I deselect a row, I am not able to find its Id or row data (which is deselected) in the js controller.
Aura:
JS:
Can anyone please help?
Regards,
Nidhi Sharma
I am working with a lightning:treegrid component.
The onrowselection attribute of lightning:treegrid invokes a method on js controller whenever a row is selected/deselected.
I am able to fetch the currently selected rows using the getSelectedRows() method.
But if I deselect a row, I am not able to find its Id or row data (which is deselected) in the js controller.
Aura:
<lightning:treeGrid columns="{!v.gridColumns}" data="{!v.gridData}" keyField="idRef" aura:id="productTree" expandedRows="{! v.gridExpandedRows }" onrowselection="{! c.getSelectedRows}" ontoggle = "{!c.handleToggle}" selectedRows = "{!v.selectedIds}" isLoading="{! v.isLoading }" />
JS:
getSelectedRows: function(cmp, event, helper) { //get selected rows var curRows = event.getParam('selectedRows'); //how to get the row that is deselected }
Can anyone please help?
Regards,
Nidhi Sharma
var selectedRows = cmp.find('treegrid_async').getSelectedRows();
Regards,
Kheta Ram Sansi
Were you able to find a solution for this? I am also having the same question. lightning:treegrid has lots of limitations regarding select and deselect which makes it practically difficult to implement and use.