Welcome to StackExchange.
What is your business requirement? Are you trying to fire a different action if the row is unselected?
AFAIK usually the behavior of datatable component selections are loading row ids for the actions that table will perform.
In LWC, there's no two way binding so you can use the getSelectedRows
to store and update the only the rows you have stored in your property when an action is called.
Edit: It seems that with aura this is possible with the test I just made below;
table attribute: onrowselection="{!c.atlasTest}"
atlasTest: function(component, event, helper){
var selectedRows = event.getParam('selectedRows');
console.log(selectedRows);
console.log(JSON.stringify(selectedRows));
},
If you use onrowselection
attribute of the table and use the event selectedRows
, this will dynamically list the rows based on your selection. (Probably because aura supports two way binding?)