So I want to add the data filter to the UL if there are certain number of LI’s. I get the attr to add correctly, but nothing shows up on page.
else
{
$('#presentations').attr("data-filter", "true");
$('#presentations').html('');
for (var i = 0; i < results.rows.length; i++) {
$('#presentations').append(
'<li><a href="javascript: loadPresentation(\'' + results.rows.item(i).presentName + '\';");">' + results.rows.item(i).presentName + '</a>'
+ '<a href="javascript: deleteConfirm(\'' + results.rows.item(i).presentName + '\');">delete</a></li>');
}
}
$('#presentations').listview('refresh');
$.mobile.changePage($('#dashboard'), {reloadPage: "true"} );
$('#dashboard .message').text('Your presentations');
}
I’m guessing its a caching issue but I can’t figure out how to work around it. Help?
I’ve tried to re-initialize, recreate or refresh the listview but none of it works.
The only way I can get it working is by doing:
So you trigger manual the
listviewcreateevent and before that you set the filter to true. (setting withattr(), data() or jqmData()also doesn’t work)Example:
http://jsfiddle.net/N7Z9e/143/