When i click on the 'Apply' button the changes are not applied to all the selected rows.
Is there a way to override the apply button . What am i missing here..Any official doc on how it works. I don't see any reference in salesforce doc
#Salesforce Developer #LWC #Datatable @* Salesforce Developers *
Hi @Albin W
After clicking "Apply" button, there would one save button at bottom of datatable.
Which would trigger "onsave" event.
Component Ref. Doc: https://developer.salesforce.com/docs/component-library/bundle/lightning-datatable/example
Example.
HTML
<lightning-datatable
key-field="id"
data={data}
columns={columns}
onsave={handleSave}
>
</lightning-datatable>
In JS,
handleSave(event){
// here draftValues is array of updated rows,
// each row is object having updated column value & id.
console.log(event.detail.draftValues);
}
Please make sure that datatable does not have "suppress-bottom-bar" attribute,
If present, the footer that displays the Save and Cancel buttons is hidden during inline editing.