I have a listview that's dynamically generated from a JSON file as such:
$.getJSON('test2.json', function(data) {
var items = [];
$.each(data, function(key, val) {
items.push('<li data-theme="c" data-icon="myapp-arrow" class="test1"><a href="#dataviewer" data-transition="slide"><p>' + key + '</p>' + val + '</a></li>');
});
$('<ul/>', {'data-role' : 'listview','id': 'my-new-list', 'data-divider-theme':'a', 'data-inset': 'false',html: items.join('')}).appendTo('.container');
alert('Here is where the refresh should fire!');
$("#my-new-list").listview("refresh");
});
It adds the list items to the page, but it doesn't style them at all. Using Chromes inspector, if I copy and paste the list code into my html document, it styles just fine. What am I doing wrong?