Is there a way to stop the draw tool of the Select widget from any other custom widget?

191
3
4 weeks ago
Vara_PrasadM_S
Frequent Contributor

Hi Team,

In our ExpBuilder App, we are using OOTB Select widget. Its draw tool to select features is on even when the Select widget is closed. Is there a way to stop the draw tool when the Select widget is closed or from any other custom widget through code dynamically?

Any inputs would be really helpful.

Thanks & Regards

Vara Prasad

0 Kudos
3 Replies
JeffreyThompson2
MVP Frequent Contributor

In the latest version of Experience Builder (1.18), placing the Select Widget in a Widget Controller and closing it will automatically deactivate the drawing tool.

GIS Developer
City of Arlington, Texas
0 Kudos
Vara_PrasadM_S
Frequent Contributor

Thank you for your reply @JeffreyThompson2. Is there a way to achieve this in ExpBuilder 1.15 version?

Can we have it customized by any of following approaches? or any other simple approach?

1. Adding a message action and sending message to deactivate the draw tool from other custom widget

2. Adding a hook to identify the widget's state and deactivate it

Please suggest. Thanks.

0 Kudos
JeffreyThompson2
MVP Frequent Contributor

https://community.esri.com/t5/experience-builder-tips-and-tricks/modifying-esri-widgets-and-making-t...

To add this behavior in 1.15, you will need to make a copy of the Select Widget and make your modifications in your copied version. 

All Widgets have a props.state property that changes when a Widget is opened or closed. You can build your modifications off of watching this property.

https://developers.arcgis.com/experience-builder/api-reference/jimu-core/WidgetState/

GIS Developer
City of Arlington, Texas
0 Kudos