From Custom Widget : anchor link ==> the row

Hey,
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.
Thanks

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:

https://docs.getgrist.com/cu6iW1CZXXXX/Untitled-document#a1.s1.r1.c2

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="https://docs.getgrist.com/cu6iW1CZXXXX/Untitled-document#a1.s1.r1.c2" target="_parent">
  <img ....
</a>
2 Likes

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

1 Like