It seems everything is correct. Could you send us app public link and step how to reproduce this issue?
I shared it with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a
The app is name CoGo. On existingScreen load, the gridLocation should be able to swipe right or left.
You didn't mentioned about your table which is populated by service.
That's why Appery("gridLocation") not point to the grid. In this case it point to the "template".
Try the following steps:
1 Delete code from the "page load".
2 Add the following code to the "success" event of the service which is populated to the grid.
pre
code
//Add Swipe Function -----------------------------------------------
$(document).off("swipe");
//Note: "mobilegrid_56" is component name you need to handle swipe events.
console.log(Appery("gridLocation"));
jQuery("[name='gridLocation']").on({
"swipeleft": function(event) {
//Here is code to handle swiptLeft event.
alert("Swiped Left");
console.log("swipeLeft");
},
"swiperight": function(event) {
//Here is code to handle swiptRight event.
alert("Swiped Right");
console.log("swipeRight");
},
});
/code
/pre
Thank you. Works perfectly now.