Table - Custom Code

I’m having an issue with the new table blocks from SOFTR. I used to have event listeners to refresh a table via a button click or when closing a popup, but since switching to the new tables, it looks like SOFTR has changed the entire dynamic, and my custom code no longer works.

Have you already solved this on your side so I don’t spend the whole day on it?

Thanks a lot for your help!

Hi,

To reload a new table block through a script, the event listenner is window.dispatchEvent(new CustomEvent('reload-table1') and not anymore window.dispatchEvent(new CustomEvent('reload-block-table1')

In other words, the syntax changed => -block- is to be removed for all new blocks (table, list, grid, item-details…) when using scripts to reload them.

Another example can be found here: Refresh after modal close? - #61 by matthieu_chateau

Hi !

Thanks for the tip about the changed syntax.
Is there any technical specification somewhere that I could “rtfm” by myself and see that this change happened ?

Anyway, I have another question about this.
When I do in my chrome console

window.dispatchEvent(new CustomEvent(‘reload-XXX’))

the table is being refreshed but there is no loader or anything visually showing there’s a refresh in progress. The older block did spin a loader.
Shall I implement a spinner by myself for new table blocks ? (if so, any snippet somewhere ?)

Thanks a lot for your help !