We recently upgraded to the Q1 2014 release and are now having problem with HTML tags not being rendered in the text element of the drop down list control. We have a custom control derived from RadDropDownList that renders labels inside of the text element (ex. "<b>Field1:</b> myvalue"). While I understand this probably isn't officially supported, it did work in the previous release we used (Q2 2013).
Oddly enough, the HTML tags do render when the page initially loads, however, when a new item is selected (which takes the item text and prepends the label and uses the set_text method to update the text of the item) it is showing the tags after HTML encoding in the text element. The HTML is rendered in the item element as expected.
I traced the issue down to the _updateTextElement method on the client side object and its call to H.text to set the text of the text element. I played around with replacing that with my own method which uses H.html and it seems to work. I also had to change the variable "a" to "$telerik.$".
I'm curious to know whether there is a better approach to this or whether I should use the override method assuming that it works and there are no issues with it.
Oddly enough, the HTML tags do render when the page initially loads, however, when a new item is selected (which takes the item text and prepends the label and uses the set_text method to update the text of the item) it is showing the tags after HTML encoding in the text element. The HTML is rendered in the item element as expected.
I traced the issue down to the _updateTextElement method on the client side object and its call to H.text to set the text of the text element. I played around with replacing that with my own method which uses H.html and it seems to work. I also had to change the variable "a" to "$telerik.$".
I'm curious to know whether there is a better approach to this or whether I should use the override method assuming that it works and there are no issues with it.
Telerik.Web.UI.RadDropDownList.prototype._updateTextElement =
function
(I) {
var
H = $telerik.$(
this
.get_textElement());
if
(I) {
H.html(I);
H.removeClass(i);
}
else
{
H.html(
this
.get_defaultMessage());
H.addClass(i);
}
this
.get_element().value = I;
};