I have a problem when using reactiveUtils.watch to monitor the view.popup. I need to catch the graphic id
to do further customize action, but I didn't find out any infos just from view.popup object.
The code snippet is as below:
reactiveUtils.watch(
() => view.popup.visible,
(visible) => {
///debugger;
// console.log("view.popup = ");
// console.info(view.popup);
if (visible) { .... }
}
);
And another problem is, when I try using other method to get the graphic, like this:
// Event handler that fires each time an action is clicked.
reactiveUtils.on(
() => view.popup,
"trigger-action",
(event) => {
console.log("event.action.id =" + event.action.id);
});
when I use chrome to debug this, I found reactiveUtils.on is not be called. So, is there any good way to
catch popupTemplate reactor's graphic id, this graphic is basically as following:
graphic = new Graphic({
geometry: new geometry.Polygon({
rings: coordinates,
spatialReference: {
wkid: 3826
}
}),
symbol: {
type: "simple-fill",
color: [255, 0, 0, 0.3], // Red color with 0.3 opacity
outline: {
color: [255, 0, 0], // Red color
width: 1
}
},
attributes: {
Name: "simple-marker",
Description: tableHTML
},
popupTemplate: popupTemplate
});
graphic.geometry.id = "checking_graphic_1"
thanks a lot.