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?

2
  • 1
    Please post your code, so that folks here can help
    – MandyKool
    Commented Jun 7, 2018 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
    Commented Jun 7, 2018 at 1:31

2 Answers 2

3

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?

1
  • 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
    Commented Jun 7, 2018 at 21:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .