Hello!
I'm currently using a custom widget to display objectids and attachment counts from a connected data source.
I'm looking for a way to click on the div containing the object id and have it highlight this data in the same way it would in a table. This way the other elements of the experience builder should dynamically update to select this point, so the map will zoom to, the table will highlight and the attachment viewer will display the attachments.
Any help with this is appreciated, thanks!
Take a look at this code sample to see how to add and remove highlights from a feature.
https://developers.arcgis.com/javascript/latest/sample-code/widgets-feature/
This seems to be for live updating on a hover.
This is the layout of my custom widget using object IDs and displaying small attachment previews:
I want to be able to add an <a> to each row in here so that it acts like the table widget as shown here:
The idea is to have the map update to a zoomed view using the ObjectID and highlight it in the table too.
Is this possible from a custom widget?
You can add an onClick event to the JSX element in your list. In the function triggered by the click event, use a goTo() function to zoom the map.
https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#goTo