Milton Davis
Posts: 0
Joined: Tue Mar 04, 2014 5:12 am

Is it possible to add Swipe event to Grid Component?

I have a grid component with several images and labels in it. Is it possible to add a Swipe event to the grid instead of each component individually?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Is it possible to add Swipe event to Grid Component?

Hi Milton,

You would need some custom JavaScript.
Run this code on page Load event:
pre$(document).off("swipe", '[name="mobilegridName"]').on({
swipe: function() {
debugger;
},
}, '[name="mobilegridName"]');/pre

Milton Davis
Posts: 0
Joined: Tue Mar 04, 2014 5:12 am

Is it possible to add Swipe event to Grid Component?

I am not sure I completely understand. The Javascript you provided, is document the page I am loading..."newScreen".

Where does this Javascript allow me to set different actions for Swipe Left or Swipe Right?

And where do I define what action I want to take once the Swipe is triggered?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Is it possible to add Swipe event to Grid Component?

Hi Milton.

Please try this code instead of suggested above:
pre

$(document).off("swipe");

//Note: "mobilegrid_56" is component name you need to handle swipe events.
Appery("mobilegrid_56").on({
"swipeleft": function(event) {
//Here is code to handle swiptLeft event.
console.log("swipeLeft");
},

Code: Select all

 "swiperight": function(event) { 
     //Here is code to handle swiptRight event. 
     console.log("swipeRight"); 
 },     

});/pre

Milton Davis
Posts: 0
Joined: Tue Mar 04, 2014 5:12 am

Is it possible to add Swipe event to Grid Component?

Do I need to change "$(document)" to the page name?

Nikita
Posts: 0
Joined: Fri Feb 28, 2014 4:02 pm

Is it possible to add Swipe event to Grid Component?

Hello,

No.

You don't need to change this code:

$(document).off("swipe");

Milton Davis
Posts: 0
Joined: Tue Mar 04, 2014 5:12 am

Is it possible to add Swipe event to Grid Component?

This code seems to work if I add it to an Image component or a label, but not for a grid. I guess the other option is to add it for all components inside the grid. Is there a way to do that easily....something like,

(document).off("swipe");
//Note: "mobilegrid_56" is component name you need to handle swipe events.
Appery("mobilegrid_56", "mobilegrid_57", "mobilegrid_58").on({
"swipeleft": function(event) {
//Here is code to handle swiptLeft event.
console.log("swipeLeft");
},
"swiperight": function(event) {
//Here is code to handle swiptRight event.
console.log("swipeRight");
},
});

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Is it possible to add Swipe event to Grid Component?

Hi Milton,

No, see this comment: https://getsatisfaction.com/apperyio/...

You would only need to change a grid name, nothing more.

Milton Davis
Posts: 0
Joined: Tue Mar 04, 2014 5:12 am

Is it possible to add Swipe event to Grid Component?

Hi Katya,

I changed the grid name, but could not get it to work. It would not detect a swipe command. If I used a different component instead of the grid, it worked, but not with the grid.

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Is it possible to add Swipe event to Grid Component?

Hello,

It should work. Could you show us screenshots with grid properties(where we can see a grid name) and screenshot with code which your are using.

Return to “Issues”