I want to trigger swipe event in javascript, how is that possible ?
Are you asking to have an function run on swipe or to simulate the swipe gesture?
i am asking to simulate the swipe gesture.
Hmm good question.
I guess a better question would be to ask what event are you trying to trigger?
I want to close list-item when i click on ion-option-button. It should hide options button and reset the list item state (i.e. Swipe to the right automatically).
Makes sense. Yes this is possible, see my demo.
$scope.edit = function(item) {
alert('Edit Item: ' + item.id);
$ionicListDelegate.closeOptionButtons();
};
http://ionicframework.com/docs/api/service/$ionicListDelegate/
great @mhartington. Thanks a lot man.
I have an updated codepen with a directive that will close the option button if you attempt to scroll as well.
is there something like $ionicListDelegate.openOptionButtons()?
If it’s not in the docs, then nope
how can i implement it ? i damn need it
. I am not good in angular.
Is there anyway to force an animation of closeOptionButtons()?
Hi men, Did you get it (openOptionButtons)?
Thanks in advance, Nicholls
@jdnichollsc
I managed to simulate the event via javascript when a click event happends on an ion-item
Basically, I managed the click evento so it would add the same translate3d transformation. Once you put the transformation, ionic’s css manages the rest.
Codepen:
Very nicee! Thanks for your response my friend!
This is my example with a hold gesture: http://codepen.io/jdnichollsc/pen/YXOqEw
Very helpful thread! Thanks guys.