dhtmlXCombo incorrectly displaying htmlEncoded options

Hi,

I am trying to get a combobox to display options with ‘<’, ‘>’ and other special characters, which require html encoding.
Using the following:

[code]

[/code]

The option displayed properly in the dropdown list, but shows the html encoded string with ‘&’ in the input box when selected.

Using the following:

[code]

[/code]

The option is blank in the dropdown list, but displayed correctly in the input box when selected.

I am using dHtmlx 4.4 Pro, but when using dHtmlx 3.6, everything works as expected.
Is this a regression or bug in dHtmlx 4.x?

Regards,

Adri.

Hi

Please add the following code rigth after dhtmlx.js is loaded:

dhtmlXCombo.prototype.modes.option.setText = function(item, text) { item._conf.text = text; var t = (typeof(text) == "object" ? window.dhx4.template(item._tpl.option, item._conf.text, true) : window.dhx4.trim(item._conf.text||"")); t = t.replace(/[\<\>\&]/g, function(t){ switch (t) { case "<": return "&lt;"; case ">": return "&gt;"; case "&": return "&amp;"; } return t; }); item.lastChild.innerHTML = (t.length==0?"&nbsp;":t); }

Andrei,

You code seems to work, but does not restore the dHtmlx 3.6 functionality.
Using version 3.6, the options were htmlencoded with < > etc.
You fix requires the options to be non encoded.
Also version 3.6 would recognize any htmlencoded options, like & ’ " or generic encodes like \.
Is it possible to ‘reverse’ your fix to supply options with htmlencoding?

Thanks,

Adri.

Hi

please provide exact sample with description about current and awaited behaviour.

Hi Andrei,

I prefer the version 3.6 behaviour.
This was my first example:

[code]

[/code]

Options strings are htmlEncoded. The example shows them hardcoded inline, but my app actually receives them from a serverside component, hence the need for htmlEncoding.
Thanks,

Adri.