I'm working with Arcgis version 4.27 and want to set click function for the content of the popup after opening the popup. As I understand, the best way is "reactiveUtils" but doesn't work properly and the length of the "$(".tblInfoWindow").find("img.Question")" is zero.
The code is:
reactiveUtils.watch(
() => mainView.popup.visible,
(visible) => {
if (visible) {
console.log($(".tblInfoWindow").find("img.Question").length);
$(".tblInfoWindow").find("img.Question").click(function () {
var layerID = $(this).attr("id").replace("question_layer", "");
var layerName = $.trim($(this).parent().text());
OpenQuestionLink(layerID, layerName);
});
}
}
);
How can I set click function for the content of the popup after opening that? Seems visible=true before opening the popup!