Reputation: 2051
I have a listview that is populated from an ajax call. The items in the list are setup to call a js function onclick which will updates another list view on the page. I want to maintain the highlighted state of the first listview's selected item until the user selects another item in the list. I've tried adding a click handler to the anchor of the list item ('li a:first')
and adding my theme's ui-btn-down class to the li but that doesn't work on my iPad. I'm hoping there's a smart way to do this that I'm too tired to think of.
Any help is appreciated.
Thanks!
Upvotes: 0
Views: 1719
Reputation: 17257
There was a similar question yesterday and I gave a solution as below.
$('#listAddr li').bind('click', function () {
$('#listAddr li').attr("data-theme", "c").removeClass("ui-btn-up-b").removeClass('ui-btn-hover-b').addClass("ui-btn-up-c").addClass('ui-btn-hover-c');
$(this).attr("data-theme", "b").removeClass("ui-btn-up-c").removeClass('ui-btn-hover-c').addClass("ui-btn-up-b").addClass('ui-btn-hover-b');
});
basically it changes the theme and removes/adds relevant classes.
You can check out an example on this Live fiddle
Upvotes: 2