EasyUI Forum
May 16, 2024, 07:56:43 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: decode html entity in combobox  (Read 9289 times)
patana
Jr. Member
**
Posts: 50


View Profile
« on: August 02, 2013, 12:32:46 PM »

In combobox, i have few values contained the entity reference in it. Can we decode it ?

« Last Edit: August 02, 2013, 06:00:19 PM by patana » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: August 03, 2013, 07:53:15 AM »

Please show your test code to demonstrate your issue.
Logged
patana
Jr. Member
**
Posts: 50


View Profile
« Reply #2 on: August 03, 2013, 09:40:06 AM »

<select class="easyui-combobox" name="state" style="width:200px;">
     <option value="AL">Alabam&a</option>
     <option value="AK">Alaska</option>
     <option value="AZ">Arizona</option>
</select>

When i choose "Alabam&a", i want it to show as "Alabam&a".
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: August 03, 2013, 06:33:11 PM »

Please override the $.fn.combobox.parseData function to solve your issue.
Code:
	$.fn.combobox.parseData = function(target){
var data = [];
var opts = $(target).combobox('options');
$(target).children('option').each(function(){
var item = {};
item[opts.valueField] = $(this).attr('value')!=undefined ? $(this).attr('value') : $(this).text();
item[opts.textField] = $(this).text();
item['selected'] = $(this).attr('selected');
data.push(item);
});
return data;
};
Logged
patana
Jr. Member
**
Posts: 50


View Profile
« Reply #4 on: August 16, 2013, 09:35:20 AM »

Thanks!! It works..
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!