From Custom Widget : anchor link ==> the row

Is it possible from an anchor link in a custom widget with a gallery view,
to click and go to the corresponding row, to open a card with all details ?
Now it’s replacing the custom widget by the Grist page.

Hi Sao,

It should be possible. You just need to create a proper anchor link for the image. First copy an anchor link for any record in the target section, it should look like this:

The r parameter is a row id, which you have access to from inside your widget (as part of onRecords event).

Then you simply create new links (in JavaScript) replacing the r parameter with the correct value. For links to work, your anchor tag should have the target attribute set to _parent:

<a href="" target="_parent">
  <img ....

OMG, merci beaucoup Jarek :heart_eyes:
I didn’t know about this value “_parent”
It worked perfectly :wink:

1 Like