ianaz
ianaz

Reputation: 2580

jQuery mobile Trigger create doesn't completely work with element added through DOM

I have to add istantly some items without reload the page. After adding these elements I call

$('#one').trigger('create');

But not everything changes as it should (screenshot: http://www.ianaz.com/9a7c50414.html ) The background stays grey, the icon at the right is not added and the text becomes link. It does not transform everything in a list "button". The third component in the screenshot is as should be. Do I have to call another method? Thanks

Upvotes: 1

Views: 781

Answers (1)

user700284
user700284

Reputation: 13620

Just before you call create,try to call listview("refresh") on the list.For eg. if list is the id of the listview,following code should be used:

$("#list").listview("refresh");

Upvotes: 5

Related Questions