javascript - Injected li items are not formatted with CSS style -
attached find jfiddle showing injection of <li>
elements - output in ways absent of defined css - opposed hard coded <li>
's - why that?
dynamically added listview elements must have markup enhanced function:
$('#listviewid').listview('refresh');
working example: http://jsfiddle.net/gajotres/lraye/
in case receive error:
cannot call methods on listview prior initialization
then restyle listview this:
$('#listviewid').listview().listview('refresh');
first listview function initialize listview , second 1 restyle it. if error mentioned earlier shown.
one last thing, if using loop or each loop add numerous li element use listview('refresh') after has been added ul element.
read more in other article/answer: jquery mobile: markup enhancement of dynamically added content, search chapter: enhance single component/widget.
Comments
Post a Comment