I want to display special spanish characters like á,Á,ã,Ã in combobox.SO, I wrote the code for it in locale file, Inglés and Español,etc. When I open the dropdown, it displays the word correctly but when I select it, it displays the code in the box. Similar thing happens with boxLabels, it shows the code instead of the special character. Can anyone suggest me a solution for it? Thank you.
Asked
Active
Viewed 872 times
1 Answers
1
The problem occurs because elements on list are rendered as divs (so html entities works) while value box is rendered as input (entities dosen't work). Easiest way is to display national characters is to replace entities with actual unicode chars. You can do that by overriding setRawValue
method:
Ext.define('Ext.ux.form.ComboBox', {
extend: 'Ext.form.ComboBox',
setRawValue: function(value) {
this.callParent([ decodeEntities(value) ]);
}
});
Fiddle: http://jsfiddle.net/9mjbf96o/2/

Krzysztof
- 15,900
- 2
- 46
- 76
-
Its giving this error:Uncaught ReferenceError: decodeEntities is not defined – user2316489 Dec 11 '14 at 13:59
-
Because you should define it. This is only snippet, not working solution. Working example is under link. – Krzysztof Dec 11 '14 at 14:07