Can't return html text?

4 posts, 2 answers
  1. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 10 May 2012 Link to this post

    I want a function to return some html into a data-bind="text: getText" but it comes across literally...like if I do

    return "<span class='incomplete'>InComplete</span>";

    then it renders
    <span class='incomplete'>InComplete</span>

    And if I encode it, it just renders the encoded strings.

    Suggestions?
  2. Answer
    Chris
    Chris avatar
    38 posts
    Member since:
    Feb 2012

    Posted 11 May 2012 Link to this post

    Have you tried using the "html" binding instead of "text" ?
  3. Kendo UI is VS 2017 Ready
  4. Answer
    Morne
    Morne avatar
    2 posts
    Member since:
    Oct 2012

    Posted 11 May 2012 Link to this post

    As Chris suggests, there is a HTML binding that you can use:

    <span data-bind="html: name"></span>
  5. Steve
    Steve avatar
    1851 posts
    Member since:
    Dec 2008

    Posted 11 May 2012 Link to this post

    Duh, stupid steve :)

    Thanks guys, totally spaced on being able to do that...was so used to text: to put in text.
Back to Top
Kendo UI is VS 2017 Ready