user2349115
user2349115

Reputation: 1286

jquerymobile - selectable list item

I want to be able to select a listview item. On select/click I can use onclick event and add class to that li. But, is there any default way in which I can select an item in the listview. I mean, when I select, it should be highlighted and I should be able to get the selected value.

Upvotes: 0

Views: 273

Answers (1)

ezanker
ezanker

Reputation: 24738

The jQM listview widget does not include any default functionality for a highlighted/selected item. Your approach of

  • handling the click,
  • adding a class, and
  • storing the currently selected item in a global or data-attribute

is a good way to go.

Upvotes: 1

Related Questions