Page 1 of 1

[REACT] Event is not getting fired in case of custom select editor component

Posted: Wed Nov 09, 2022 1:01 pm
by suhas.kachare

Hi Team ,

I am using custom editor for cell editing. And I'm trying to fire an event finishCellEdit, when my editing is finished . In case of of text editor the event is firing properly but when I'm using select editor component , the event is not getting fired.

Below is the code of finishCellEdit event

const config = {
    features: {},
    autoHeight: true,
    columns: {
      data: [...column],
    },
    data: gridData,
    listeners: {
      finishCellEdit: () => {
        console.log("finishCellEdit called");
      },
    },
  }
  

So can you please guide me on this issue.


Re: [REACT] Event is not getting fired in case of custom select editor component

Posted: Wed Nov 09, 2022 3:36 pm
by alex.l

It works well in our Basic Grid React demo. Please post your application, we will check what's wrong!


Re: [REACT] Event is not getting fired in case of custom select editor component

Posted: Wed Nov 09, 2022 4:00 pm
by suhas.kachare

Please find below attached demo application.


Re: [REACT] Event is not getting fired in case of custom select editor component

Posted: Thu Nov 10, 2022 5:04 am
by alex.l

Ok, I checked your code and see the problem.
You used Ant combo as an editor for second cell, with change callback workaround.
So, when you clicked on dropdown list, focus lost from a cell and cell editing is finished with no changed value. Since no change has been made, finishCellEdit won't be triggered on blur. Workaround for this type of custom editors - manually apply change to the record after cell edit finished (actually canceled by blur).
I am afraid you need to handle this case manually. Maybe trigger your own event on change apply.