0

I am using lightning:datatable to display data and it has the ability to inline edit. I was wondering if there's some sort of event handler when a cell is being edited (when the user clicks the pencil icon on the table cell for inline edit)?

The reason I asked is I would like to disable a button outside of the datable during an inline edit. I looked through the lightning:datatable documentation but no luck.

Thanks in Advance

1

1 Answer 1

1

You can use oncellchange here.

From documentation (emphasis mine):

You can handle the oncancel, oncellchange, and onsave actions when the cell value changes or is saved.

3
  • 1
    I'm having this problem now. The oncellchange event - certainly in LWC anyway - only fires when the user blurs away from the edit, ie they click on something other than the input field after making a change. Does anyone know if we can capture an event when the user actually clicks the pencil icon, or as soon as they type a change?
    – ministe
    Commented Dec 17, 2020 at 16:38
  • @ministe Were you able to find any solution?
    – Shanky
    Commented Dec 27, 2023 at 22:02
  • @Shanky yes I just used onchange in addition to oncellchange to handle the two different scenarios!
    – ministe
    Commented Dec 28, 2023 at 21:17

You must log in to answer this question.

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