This is something that was asked before but I still can't get it to work. I'm adding a dynamic content to a page (a list-view) and the CSS is getting lost after adding it. I read about the trigger("create") and even after adding it, the CSS is not applied.
$('#MyClubsListDiv').append('<ul id=\"MyClubsList\" data-role=\"listview\"></ul>').trigger("create");
for (var i=0; i<MyClubsReply.length; i++)
{
addClub('#MyClubsList',MyClubsReply[i].Name,MyClubsReply[i].LogoImg,MyClubsReply[i].LastUpdate);
$('#MyClubsListDiv').trigger("create");
}
function addClub(section,clubName,logoFile,LastUpdate)
{
$(section).append('<li class=\"ClubListItem\">' +
'<a href=\"#ClubPage\" data-transition=\"slide\">' +
'<img src=\"' + PiccoloServer + 'ClubLogos/' + logoFile + '\" class=\"listview-logo-thumb\" />' +
'<div class=\"ClubListContent\">' +
'<h1 class=\"ClubListH1\">' + clubName + '</h1>' +
'<p >20 Offers Available</p> ' +
'</div>' +
'<p class=\"ui-li-count\">25d</p>' +
'</a>' +
'</li>').trigger("create");
}
"MyClubsReply" is a JSON object.
What am I doing wrong? (Or not doing?)