TreeView with HTML tags

2 posts, 0 answers
  1. Abhijeet
    Abhijeet avatar
    1 posts
    Member since:
    Jul 2015

    Posted 06 Jul 2015 Link to this post



    I am really new to the Kendo UI Controls and thinking to integrate it in my web application.

    The issue I am facing is binding the Treeview with the HTML tags as my dataTextField.


    My controller is returning me List of strings, which I use for binding as JSON data to my VIEW.

    The list of string contains string as below

    "<span id='spn1' style=' font-weight: bold;'>text1</span> <a href='someFunction()'>text2</a> text3"

    So, my Tree-node should display me output as :

    text1 text2 text3


    Instead of this, it displays my tree as-is with HTML tags. like above string.

    So, What really concern is, is it possible to achieve my target? And if yes, What is the solution on this?


  2. Alexander Popov
    Alexander Popov avatar
    1411 posts

    Posted 08 Jul 2015 Link to this post

    Hi Abhijeet,

    This behavior is expected, because the text field is not encoded as HTML. The simplest workaround would be to use a template, as shown here.

    Alexander Popov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top