EasyUI Forum

General Category => Bug Report => Topic started by: sean on September 26, 2013, 12:43:23 AM



Title: Data contained " >,etc. special symbols, Unable to display properly
Post by: sean on September 26, 2013, 12:43:23 AM
Code:
<input class="easyui-combobox" 
name="language"
data-options="
url:'combobox_data3.json',
method:'get',
valueField:'id',
textField:'text',
panelHeight:'auto'
">
Code:
combobox_data3.json:
[{
"id":"\"abc",
"text":"\"abc"
},{
"id":"&gt;",
"text":"&gt;"
},{
"id":">",
"text":">"
}]

Unable to display properly


Title: Re: Data contained " &gt;,etc. special symbols, Unable to display properly
Post by: stworthy on September 26, 2013, 01:56:14 AM
To solve this issue, please use 'formatter' function to format '&' character to another string.
Code:
<input class="easyui-combobox" 
name="language"
data-options="
url:'combobox_data3.json',
valueField:'id',
textField:'text',
panelHeight:'auto',
formatter:function(row){
return row.text.replace(/&/g,'&<span></span>');
}
">