EasyUI Forum

General Category => Bug Report => Topic started by: crosemffet on December 03, 2012, 02:40:39 PM



Title: possible bug in combobox
Post by: crosemffet on December 03, 2012, 02:40:39 PM
making combobox with 3 options: equal, greater than and contains:
using following code:
<select name="selector" id="selector" class="easyui-combobox"><option selected="selected" value="0"></option><option value="1">=</option><option value="2">>=</option><option value="3">><</option></select>
when the users select option 2 the combobox display &gt,=
same thing with selection 3, the combobox displays &gt,&lt,
seems to me that is a html entities problem.
please correct me if I'm wrong, and let me know if any chance to solve it...
thanks in advance,


Title: Re: possible bug in combobox
Post by: stworthy on December 03, 2012, 08:55:56 PM
Try the following code to solve this escaping issue.

Code:
<select name="selector" id="selector" class="easyui-combobox"
data-options="onLoadSuccess:function(){
var tmp = $('<div/>').appendTo('body');
var rows = $(this).combobox('getData');
for(var i=0; i<rows.length; i++){
tmp.html(rows[i].text);
rows[i].text = tmp.text();
}
tmp.remove();
}">
<option selected="selected" value="0"> </option>
<option value="1">=</option>
<option value="2">>=</option>
<option value="3">><</option>
</select>