PDA

View Full Version : htmlDecode - what am I missing?



PCSpectra
14 Dec 2010, 10:23 AM
I have a lot of text sent to client from server which has been encoded server-side - must be done this way.

So I have a combobox that allows users to search via keywords and the list populates with text descriptions appropriately. However I added a listener to the combobox:




listeners: {
select: function(combo, record, index){
var temp = Ext.util.Format.htmlDecode(combo.getValue());

Ext.getCmp('id_combo_description').setValue(temp);
combo.setValue('');
}
}



The above code is failing to convert HTML entities into the visual characters users are expecting to see??? What about this conversion am I missing?

I have used FireBug to determine the description text is indeed converting any entities to HTML equivelants on the server side - which again must be done on server side - otherwise PHP json_encode() seems to blank the whole field on certain characters.

p.s-I am running extjs 3.2.1

Cheers,
Alex

arthurakay
14 Dec 2010, 5:38 PM
I'm failing to understand you... if you set a break point in firebug here:

var temp = Ext.util.Format.htmlDecode(combo.getValue());

What is "temp"? Is it the value you expect? If not, is "combo.getValue()" what you are expecting?

Also, do us a favor and give an example of the value you're attempting to decode.