EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: tony11 on January 18, 2014, 07:43:11 AM



Title: combobox problem
Post by: tony11 on January 18, 2014, 07:43:11 AM
I have a simple combobox, and it works as expected :

Code:
<select class="easyui-combobox" id="tcia1Browser">
  <option value=""></option>
  <option value="ie">Internet Explorer</option>
  <option value="ff">Firefox</option>
  <option value="other">Other</option>
</select>

Then I generate the same with jquery :

Code:
var the_html = 
'<select class="easyui-combobox" id="tcia1Browser" name="tcna1Browser"> ' +
'  <option value=""></option> ' +
'  <option value="ie">Internet Explorer</option> ' +
'  <option value="ff">Firefox</option> ' +
'  <option value="other">Other</option> ' +
'</select>';

$('#tcia1').html(the_html);

Now a default combobox appears, it is no longer styled with EasyUI.
Do I have to add some kind of refresh/redraw in javascript?


Title: Re: combobox problem
Post by: stworthy on January 19, 2014, 07:30:35 AM
Please try this:
Code:
$('#tcia1').html(the_html);
$.parser.parse('#tcia1');


Title: Re: combobox problem
Post by: tony11 on January 20, 2014, 10:34:52 AM
Indeed, now everything is ok.
Thanks very much.