0
votes

I have this files to detect the direction of swipe.

xml:

<StackLayout orientation="vertical" swipe="onSwipe">
    <Label id='swiped' text='test' />
</StackLayout>

js:

function onSwipe(args) { 
    page = args.object;
    var sb = page.getViewById("swiped");
    sb.text  = 'direction'+ args.direction;
}
exports.onSwipe = onSwipe;

I am not sure why I can't get args.direction.

1
Can you give some more information about which version of {N} you are using and on what device or emulator you are testing. With the latest official version 1.4.2, I am getting the direction when I am swiping, using the code you provided. - Neli Chakarova
im using 1.4.0 ..does this version does not support the direction yet? hmm.. - Camille Lagrama
Actually, there was a problem with taking the object in 1.4.0, so this might be the problem. I would suggest upgrading to 1.4.2. - Neli Chakarova
Hmm.. its strange, im not getting the direction.. ..Im using an iphone4s simulator.. - Camille Lagrama
I just changed my previous comment :) - Neli Chakarova

1 Answers

-1
votes

You need to enable the cell scrolling in the XML declaration: swipeCells="true"

<lv:RadListView items="{{ dataItems }}" swipeCells="true" itemSwipeProgressEnded="{{ onSwipeEnded }}">

For future reference here is a tutorial by Telerik about getting the x and y directions: http://docs.telerik.com/devtools/nativescript-ui/Controls/ListView/listview-features-swipe-to-execute