1
votes

Inside my Ionic application, Let's say I have an ion-list with some ion-items inside like this:

<ion-list>
  <ion-item>
    I love kittens!
    <ion-option-button class="button-positive">Share</ion-option-button>
    <ion-option-button class="button-assertive">Edit</ion-option-button>
  </ion-item>

  // Some other items in the list

</ion-list>

I want to programmatically (e.g click of a button), open up the option menu on all the items. Same effect as if the user has swiped all the items to the left simultaneously.

I was not able to find any documentation on this. How can I achieve that?

1
Hey @niklas, I did take a look at that document but there is no information in there that says something about opening option buttons. There is closeOptionButtons() but it's quite the opposite of what I'm trying to achieve.Sobhan
i thought it might help. however when initialized, the option buttons have the class class="item-options invisible" you might want to try to get rid of the invisible programaticallyniklas
@niklas, nice idea. I'll try that soon and let you know the outcome.Sobhan
@niklas, unfortunately removing or adding the invisible class didn't generate the desired effect. As a matter of fact, when i removed it, nothing changed: the button stayed hidden.Sobhan

1 Answers

0
votes

I know it's pretty late but it's for someone who wants to do that same.

This not an actual solution but a direction to get it done.

You need to find out the call ionic gives on left/right swipe of item and just call that method from your code(off course after adding required dependencies).