Trigger afterSetCellMeta only when user acts manually

Tags: #<Tag:0x00007f8b2a22bea8>

Hi,
Is there a way to trigger “afterSetCellMeta” only when the user acts like using mouse click and keypress. Currently the “afterSetCellMeta” gets triggered when the table is rendered automatically. Please help.

Hey @shajibaig

sorry, it does not have any parameters that can determine a source of change. Ca you share more details about your scenario? Maybe I’ll be able to share some tips.

Hi @aleksandra_budnik,

I have successfully added option to add color to cells using “setcellmeta” by adding “className”. And also, I save the cell “className” to backend database using the “afterSetCellMeta” hook.

During the page load, I add these classes back to the table using “setcellmeta” in a loop from the server using php. However during this the “afterSetCellMeta” hook is triggered automatically and sends multiple requests to the server as many cells have the “className” set.

So, I need a way to stop the trigger of “afterSetCellMeta” when the classes to the cells are added during initial page load.

I am sorry but there is currently to way to add an additional parameter to setCellMeta that will allow us to differ if it should trigger the hook or not. Without it, the change would not be visible in the table.