Pasteur Miranda
Posts: 0
Joined: Thu Aug 01, 2013 2:59 am

how to get the selected item index from a list?

Hi,

Code: Select all

How to get the selected item index from a list? 

Thank you

Pasteur Miranda
Posts: 0
Joined: Thu Aug 01, 2013 2:59 am

how to get the selected item index from a list?

Hi Max,

Thank you for your answer, but I need to get the selected item in the list, in order to show it in the next page. The tutorial does not access the selected item index.

Code: Select all

Thank you very much,
Pasteur Miranda
Posts: 0
Joined: Thu Aug 01, 2013 2:59 am

how to get the selected item index from a list?

As a complement to my last reply I need to invoke the listview click event and, inside it, get the selected item index.

Thanks

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

how to get the selected item index from a list?

Hi,

Next code should help:
precode
Appery("mobileselectmenu_44").find(":selected").index();
/code/pre

Please change your component name.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

how to get the selected item index from a list?

Check the generate code, I think the index should be in the element. If yes, you can read it. If not, you would need to add a custom attribute that holds the index of the item.

Pasteur Miranda
Posts: 0
Joined: Thu Aug 01, 2013 2:59 am

how to get the selected item index from a list?

I think this should work to select menu widget, but I tried to listview and it returns only the index -1. Any other suggestion?

Code: Select all

Thank you all.
Pasteur Miranda
Posts: 0
Joined: Thu Aug 01, 2013 2:59 am

how to get the selected item index from a list?

Hi,

Code: Select all

Do you have any other suggestion? Isn't it possible to get the selected item index from listview as you get it from select menu? 

Thank you very much.

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

how to get the selected item index from a list?

Hi, Pasteur.
Add Run JavaScript action on click event on mobileList with this code
alert($(this).find("li:not([_tmpl=true])").index($(arguments[0].target).parents("li")));

Pasteur Miranda
Posts: 0
Joined: Thu Aug 01, 2013 2:59 am

how to get the selected item index from a list?

Hi Oleg,

Thank you very much, this code worked!

Again, your support and application builder is amazing. Congratulations!

Return to “Issues”