binding html inside a template

2 posts, 0 answers
  1. Mark
    Mark avatar
    16 posts
    Member since:
    Apr 2012

    Posted 09 Jul 2012 Link to this post

    Hi,

    Consider the jsfiddle: 

    http://jsfiddle.net/brCCY/1/ 

    For the span tag what I'd like to be able to do is 'set' the html (ala innerHTML) of this element using 'Body' however the example I've given fails silently.

    I've trawled through http://www.kendoui.com/documentation/framework/templates/overview.aspx and I probably got the inspiration for the possibility from: 
    http://www.kendoui.com/blogs/teamblog/posts/12-03-20/mvvm_declarative_initialization_and_html5_data_attributes.aspx 
    In my case (where I am using MVVM on top of the template) - I have had no issues binding other things like attr, events etc.

    Any thoughts?

    Thanks,

    Mark.
  2. Mark
    Mark avatar
    16 posts
    Member since:
    Apr 2012

    Posted 10 Jul 2012 Link to this post

    After reading further posts in the thread I resolved this myself.

    instead of ${Body} or the bind approach

    #= Body #

    Leaves the HTML unescaped.

    I think the documentation could explain this a little better e.g. where it talks about encoding HTML it could show the unencoded results also?

    Thanks,

    Mark.
  3. Kendo UI is VS 2017 Ready
Back to Top