custom image widget that toggles between 2 images ("off" image and "active" image) by clicking the image

157
2
4 weeks ago
Labels (2)
MichaelLev
Frequent Contributor

esri experience builder developer edition "image" widget allows me to upload one image.

I want to make a custom "image" widget which uploads 2 images, one noting the "off" state and the other noting the "on" state. In run time, by clicking the image, the code will toggle between those 2 images.

0 Kudos
2 Replies
JeffreyThompson2
MVP Frequent Contributor

Something like this will work.

return (
  {on ? <img src='/image1.jpeg'></img> : <img src='/image2.jpeg'></img>}
)
GIS Developer
City of Arlington, Texas
0 Kudos
MichaelLev
Frequent Contributor

I think I need do quite a few modifications in several files...

What I need is that the 2 images will serve for "off" and "on" states of the widget,

and that the widget will remember all the time, the data of the 2 images.

I need also that the widget setup will enable it to function  either as a "single image widget" (as currently), 

or as a "on-off" widget (with 2 images)

0 Kudos