• Nidhi Sharma 144
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
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:
<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

If I change my user's locale, what all things would be affected in salesforce system?
Can anybody please help with that?

Regards,
Nidhi Sharma

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:
<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