jquery mobile listview refresh same list lose style

I'm trying to update the content of a ul list passing from a list to another one. The 1st list is generated from a search form wich calls a ajax request. It's styled correctly. For the second list i use empty() on the list and get the parameter to search (via ajax) from the 1st list as a link attribute

$('.myLink').live("vclick", function() {
    var param= $(this).attr('id');

The feature is working. But the 2nd list doesn't have the jquery mobile style.

On pageshow I'm refreshing the list


but pageshow triggers only when I generate the 1st list, not the second one (which is in the same ul as the 1st).

I tried pageinit, pagecreate, pagechange and pageshow but none of them triggers when I update the list.


Refresh the list just after you've updated it's HTML. Something like:

$("#listID").append($("<li />").text("Some Text")).listview("refresh");

Here is a demo: http://jsfiddle.net/R98La/

Need Your Help

Select 2nd to last date with Group By

mysql sql join

I have the following query which I hoped would grab the data with the second to latest date

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.