Dear users,
I`m still on my way to learn "ArcGIS Maps SDK JS".
I have successfully created an Expand-widget like:
const expandbutton = new Expand({
view: view,
content: "<br><b>Legende</b><br>",
label: "Legende",
id: "legendendings",
expandTooltip:"Legende",
expanded:false,
container: document.createElement("div")
});
view.ui.add(expandbutton, "bottom-right");
In the API-documentation (https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Expand.html) I find the "on"-function.
I would like to test it like:
expandbutton.on("click", function(event){
alert ("hello");
});
...but if I lick on the expandbutton no "hello" appears. Do I misunderstand someting?
Solved! Go to Solution.
The "click" event is not available in the expand widget. Instead, I would recommend watching the "expanded" property, as shown in the code snippet below.
expandbutton.watch("expanded", (value)=>{
console.log(`expanded: ${value}`);
})
The "click" event is not available in the expand widget. Instead, I would recommend watching the "expanded" property, as shown in the code snippet below.
expandbutton.watch("expanded", (value)=>{
console.log(`expanded: ${value}`);
})
Thank you very much 🙂