Pages

Subscribe:

Ads 468x60px

Monday, March 12, 2012

How to Update a List View In Jquery Mobile



In this we programming tutorial we will learn that how we can update our List view in Jquyer Mobile, below is the a bit description<br />
 A list view is probably the most complex element that jQuery Mobile produces, and is
also one of the most common that we’ll use in our application.
jQuery Mobile list views are created using the listview widget that we use in our almost every application. Like other jQuery widgets, the listview widget can expose methods for us to call after initialization. As
of this writing, the listview widget exposes the refresh method, which you can use to update a list view.

<script>
// Initialize the list view
$("ul.twitter-feed").listview();
var updateTweets = function() {
// Go get more tweets and prepend them to the list and then
// refresh the list view.
var strNewTweetsHtml = getNewTweets();
$("ul.twitter-feed").prepend(strNewTweetsHtml).listview("refresh");
}
</script>

No comments:

Post a Comment