I have a MVC Kendo UI AutoComplete control that I am binding to json data that contains HTML.
View:
@(Html.Kendo().AutoComplete()
.Name("MyAutoComplete")
.DataTextField("Text")
.Template("${ data.Text }")
.DataSource(ds => ds.Read( read => read.Action("GetAutoCompleteItems", "Home"))
.ServerFiltering(true)
)
.MinLength(3))
Controller:
public JsonResult GetAutoCompleteItems(string text)
{
var response = new List<SelectListItem>();
response.Add(new SelectListItem{Text="<strong>My Html</strong> Text", Value="1"});
return Json(response, JsonRequestBehavior.AllowGet);
}
I can see that the control is encoding the template here:
'var o,e=kendo.htmlEncode;with(data){o=''+()+'=e( data.Text )';;o+='';}return o;'
Is it possible to turn this off? I just want to highlight the text that matches my search string.