Injected radio controlgroup does not get styling

Injected radio controlgroup does not get styling

I'm trying to take a JSON response array and turn this in to a radio controlgroup.

I have the following function:
  1. function ControlView(parent, control_name, data) {
  2.     this.control = control_name;

  3.     this.container = $( '<form><fieldset data-role="controlgroup" data-type="horizontal" data-mini="true"></fieldset></form>')
  4.     var option_char = 'a';
  5.     for (var key in data['options']) {
  6.         var input = $( '<input type="radio" name="radio-choice-h-2" id="radio-choice-h-6' + option_char + '" value="' + key + '"><label for="radio-choice-h-6' + option_char + '">' + data['options'][key] + '</label>' )
  7.         input.appendTo( this.container.children() );
  8.         option_char = String.fromCharCode(option_char.charCodeAt(0) + 1);
  9.     }
  10.     this.container.appendTo(parent).trigger("create");
  11.     this.container.controlgroup("refresh")

  12.     this.container.data('view_obj', this);
  13. }

Calling it results in this HTML:
  1. <form class="ui-corner-all ui-controlgroup ui-controlgroup-vertical">
  2.   <div class="ui-controlgroup-controls">
  3.     <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
  4.       <input type="radio" name="radio-choice-h-2" id="radio-choice-h-6a" value="vcr">
  5.       <label for="radio-choice-h-6a">HTPC</label>
  6.       <input type="radio" name="radio-choice-h-2" id="radio-choice-h-6b" value="aux1">
  7.       <label for="radio-choice-h-6b">Wii</label>
  8.       <input type="radio" name="radio-choice-h-2" id="radio-choice-h-6c" value="cbl">
  9.       <label for="radio-choice-h-6c">FiOS</label>
  10.       <input type="radio" name="radio-choice-h-2" id="radio-choice-h-6d" value="CD">
  11.       <label for="radio-choice-h-6d">BT</label>
  12.     </fieldset>
  13.   </div>
  14. </form>

The problem is that the result does not appear to be styled.  It is just a row of radio buttons.

Is there something I need to call in order to trigger this?

Thanks,
Devan
    • Topic Participants

    • devan