4

I have a code in jquery mobile that will add buttons dynamically in a listview. The problem is that when I add a button on listview dynamically the style of the button disappears.

Here's the code: http://jsfiddle.net/eLENj/98/

I've tried to use the .button("refresh") but doesn't work.

How to solve the problem?

Paul Nicolas
  • 43
  • 1
  • 3

1 Answers1

8

Just use trigger("create")

http://jsfiddle.net/eLENj/101/

Read more: http://jquerymobile.com/test/docs/pages/page-scripting.html

r0m4n
  • 3,474
  • 3
  • 34
  • 43
  • @Jasper, the reason it works is because you are triggering the internal event that causes the widget to be instantiated in the first place. The jQuery Mobile javascript source isn't terribly complicated to read. :-) – Norman H Jan 03 '13 at 18:17
  • New read more link: http://view.jquerymobile.com/master/demos/faq/injected-content-is-not-enhanced.php – the_new_mr Apr 03 '13 at 12:17