Doesn't seem to be working.
I am trying to watch the esri-popup__pagination-next class.
This the code I've tried. Is there a better way to do this?
$( ".esri-popup__pagination-next" ).on( "click", function(e) {
query(".esri-popup__pagination-next").on("click", function(e) {
Solved! Go to Solution.
Jay,
Your issue is that the popup next button is not part of the dom when you execute that code so the query returns a null pointer. You need to ensure the object exists in the dom first.
watchUtils.whenOnce(view.popup, "visible", function(){
query(".esri-popup__button.esri-popup__pagination-next").on("click", function(e) {
console.info(e);
});
});
Jay,
Your issue is that the popup next button is not part of the dom when you execute that code so the query returns a null pointer. You need to ensure the object exists in the dom first.
watchUtils.whenOnce(view.popup, "visible", function(){
query(".esri-popup__button.esri-popup__pagination-next").on("click", function(e) {
console.info(e);
});
});
Thanks Robert!
It is now working, although only for the previous button, not the next button. It also fires when you click on the numbers. I have it querying ".esri-popup__button"
I have tried quite a few combinations of classes and elements. I think.
Any idea why it wouldn't fire on the next button?
.esri-popup__navigation worked!