#6007 closed bug (notabug)
autocomplete doesn't html
Reported by: | shahraship | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | ui.autocomplete | Version: | 1.8.4 |
Keywords: | autocomplete | Cc: | |
Blocked by: | Blocking: |
Description
I just updated jqueryui to 1.8.4 and I return JSON data back as a result. My label contains HTML however, autocomplete doesn't parse html properly. It just displays HTML as string. It wasn't the case in 1.8.2 For example my result json string is : [{"id":"1", "value":"Test User", "label":"<img src=\"\/images\/icon-female.gif\" alt=\"Test User Image\" width=\"30\" height=\"30\" align=\"left\" \/> Test User<br \/><i>NEW YORK, NY<\/i>"}]
Instead of parsing the HTML it shows the HTML text in the list. In 1.8.2, the HTML is properly rendered.
Change History (3)
comment:1 Changed 12 years ago by
Component: | ui.core → ui.autocomplete |
---|---|
Resolution: | → invalid |
Status: | new → closed |
comment:2 Changed 12 years ago by
I tried this as mentioned in the documentation:
$("#q").autocomplete({source: [{"id":"1", "value":"Test User", "label":"<img src=\"\/images\/icon-female.gif\" alt=\"Test User Image\" width=\"30\" height=\"30\" align=\"left\" \/> Test User<br \/><i>NEW YORK, NY<\/i>"}], html: true});
It still doesn't render HTML properly, am I doing wrong?
This was an intentional change and is mentioned in the 1.8.4 changelog. There's an extension to add support for HTML labels.