From the course: jQuery Mobile Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Basic list views - jQuery Mobile Tutorial
From the course: jQuery Mobile Essential Training
Basic list views
Okay, let's learn about building List Views in jQuery Mobile. Now, as I mentioned previously, jQuery Mobile can enhance lists that are both ordered and unordered. And all you need to do is put a data-role attribute, named listview, on the list that you want to be enhanced. If you want items to be tappable, then you make them links inside the list items themselves of the list that you're working with. If you want to create divider items all you need to do is put the data-role equals list-divider on the list item that you want to be a divider. So, with that in mind, let's jump over to the code and start building some simple lists. Okay, so here in the code I've strolled down to chapter five in my Basic List Views section right here, and let's open up basiclistview_start. And you can see in here that I've got two lists. I've got one that's Ordered and one that's Unordered. So, before we do anything at all, let's just copy the data-role equals listview attribute. And we'll put that on…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.