[Custom Widget] - onRecord not being triggered on subsequent selection

Hi,

I’ve been following the doc on the custom widget to trigger the onRecord event. I’ve tried different approach (including this one: Custom widget: How to get values of columns? - #6 by cpind)

But I get invariably the same result : getting the first row selected in the onRecord callback but no other subsequent selection change

I tried to strip down the issue to the smallest repro case using the minimal widget (in this case the onRecord widget): Minimal Custom Widget - Grist

What is interesting is that it works on the public.getgrist.com (I see the current selected row data being displayed as json) url but when I import the same widget (at least I believe that’s the same - it’s called “inspect record” widget) on a https://docs.getgrist.com/ I experience the same issue.

Is there some additional confiuration need for a custom widget to receive the onRecord events ?

Thanks in advance for your help !

Hi @Matthieu_Veillon, are your widgets linked (Linking widgets - Grist Help Center)? You can debug by in place of a custom widget, just using a card widget, and see if the card widget moves to be the correct one.

Thanks @paul-grist for the quick reply - it was spot on.

When you create a custom widget there is a “SELECT BY” dropdown where the default value is “select widget” - I was not changing it. At this stage for your widget to be properly linked you need to specify the right table at this stage. (which was unclear to me as you already select the data source under select Data pannel) - screenshot below for reference

Maybe the UI could be clearer there @paul-grist on how not changing the default value can impact the custom widget.

I spent a day debugging my code rather than questionning the configuration :slight_smile:

Thanks again for your help !

1 Like