You need to sign in to do that
Don't have an account?
lighting:dataTable not working for when select more than one checkbox values in salesforce
<aura:registerEvent name="oSelectedRecordEvent" type="c:skillCompEvent"/>
<aura:attribute name="selection" type="List" />
<lightning:datatable keyField="id"
data="{!v.skillList}"
columns="{!v.skillColumns}"
onrowselection="{! c.getSelectedName }"
/>
Controller:
getSelectedName: function (component, event,helpder) {
var selectedRows = event.getParam('selectedRows');
var setRows = [];
for (var i = 0; i < selectedRows.length; i++){
setRows.push(selectedRows[i]);
var compEvent = component.getEvent("oSelectedRecordEvent");
compEvent.setParams({
"recordByEvent" : selectedRows[i].Id
});
compEvent.fire()
component.set("v.selection", setRows);
}
Now this code saves the only one record Even if i select more than 1 checkboxes ......
can anyone pls chck and let me know whats wrong in this code
Thanks
Since the posted code is not complete, I am unable to replicate this behavior in my org. The process would be to
1. get records List from apex controller
2. select the records
3. process the selected contacts
Try the code approach listed in https://www.biswajeetsamal.com/blog/lightning-table-with-multiple-checkbox-select-options/
Thanks