Hi there.
I'm creating a list item and inserting it dynamically. All that is working however the advanced jquery mobile styling is not being applied. I have tried creating the items various ways:
a = document.createElement("a");
$(a).addClass("add-count");
$(a).attr("data-role", "button");
$(a).attr("data-icon", "plus");
$(a).attr("data-inline", "true");
$(a).attr("href", "#");
$(a).text("add");
$(span).append(a);
the span is appended to the outer LI item, then this is appended to the UL and then I call the refresh:
$('#my-basket').listview('refresh');
This at least partly works as I have an IMG as the first element and it does become a thumbnail as expected, but none of the buttons get styles. If I manually add the styles...
$(a).addClass("add-count ui-btn ui-btn-up-c ui-btn-inline ui-btn-icon-notext ui-btn-corner-all ui-shadow");
It does style correctly but then there is the magical inner span with the image in it... etc.
I rewrote the string at page creation time and it renders correctly. When I use the same string and just append it to the UL dynamically, it does not render correctly.
How can I make jquery mobile add the bits it needs to my anchor above?
Thanks for the help.