Gopinath Gunanithi
Gopinath Gunanithi

Reputation: 39

Jquery mobile - radio button widget for dynamic html contents created via ajax

I am new to jQuery mobiles. The radio button widget is properly rendering if I hard code that in a HTML file but the widget is not loading for the same HTML contents which I dynamically created from JavaScript via Ajax.

when i try checkboxradio( "refresh" ), I am getting an error like

"cannot call methods on checkboxradio prior to initialization; attempted to call method 'refresh'"

Any suggestion on how should I refresh the dynamic contents to get the JQM widgets?

Upvotes: 2

Views: 582

Answers (1)

Omar
Omar

Reputation: 31732

Enhance the markup of Checkbox and Radio buttons dynamically using both .checkboxradio() and .trigger('create').

$('input[type=radio]').checkboxradio().trigger('create');

Upvotes: 2

Related Questions