1

I want to remove the standard buttons "Cancel" and "Save" in a lightning dataTable when a record is edited. I want to retrieve the values for a Wrapper Class through the onchange event when the record is edited, but I don't want to visualize the default buttons of the componententer image description here

Any idea?

  • 1
    Please post your code, so that folks here can help – MandyKool Jun 7 '18 at 1:30
  • 1
    I dont recal those buttons being part of the datatable, they must have been added there, you will have to post your code for further assistance – glls Jun 7 '18 at 1:31
2

You can use <lightning:datatable suppressBottomBar="true" ... />

0

Using inline edit will automatically make those appear since it evaluates the draftvalues attribute. The yellow also appears when you have any changes.

Assuming you solve for that, you can inspect the element generated and just use a CSS override to visibility: hidden. Of course, subject to break if they change their container or css classes for you to target.

There's not really an onchange event for the cell from what I can recall. You might get away with putting a change handler on the v.draftvalues attribute but I'm not sure that will work for sure?

  • Thanks @tsalb, I decided used that buttons. As you mentioned draftvalues can be useful, so I will use it, as the buttons too. – Marco Zp Jun 7 '18 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.