function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sally yamaksally yamak 

Lightning Web Component Datatable

Hello everyone,how can i remove the cancel and save button that appear on inline edit in lightning web component datatable.
Deepali KulshresthaDeepali Kulshrestha
Hi sally,
 
Clearing the draftValues attribute on the lightning:datatable component clears the edited cells and hides the Save and Cancel buttons at the bottom of the table.

e.g.

cmp.find("table-component-id").set("v.draftValues", null);

You can check this link,it will help you:

https://salesforce.stackexchange.com/questions/218407/lightningdatatable-component-hiding-save-and-cancel-buttons-after-inline-edit

https://developer.salesforce.com/forums/?id=9060G0000005oevQAA

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

 Thanks and Regards,
 Deepali Kulshrestha
 
{tushar-sharma}{tushar-sharma}
You need to disable the inline edit then only you can remove the buttons or after save clear this.  this.draftValues = [];

You can find ready to use LWC datatable component here: https://newstechnologystuff.com/2019/03/24/lightning-web-components-datatable-with-lazy-loading-inline-edit-and-dynamic-row-action/
Dhanik L SahniDhanik L Sahni
You can use suppress-bottom-bar property on datatable component.  suppress-bottom-bar={isSuppressbottom} isSuppressbottom will be declared and changed based on event (onSubmit).