Creating href items in ListView from json feed

2 posts, 0 answers
  1. Scott
    Scott avatar
    26 posts
    Member since:
    Oct 2007

    Posted 29 Dec 2012 Link to this post

    I am trying to create a dynamic set of href items in a list view from json.  The sample json is below.
    [
    {"DayOfWorkOut":"<li><a href='#DayFive' data-role='button'  style='display: block; margin: .25em; text-align: left;' data-transition='slide'>12/5/2012</a></li>"},
    {"DayOfWorkOut":"<li><a href='#DayFive' data-role='button'  style='display: block; margin: .25em; text-align: left;' data-transition='slide'>12/5/2012</a></li>"},
    {"DayOfWorkOut":"<li><a href='#DayFive' data-role='button'  style='display: block; margin: .25em; text-align: left;' data-transition='slide'>12/5/2012</a></li>"},
    {"DayOfWorkOut":"<li><a href='#DayFive' data-role='button'  style='display: block; margin: .25em; text-align: left;' data-transition='slide'>12/5/2012</a></li>"},
    {"DayOfWorkOut":"<li><a href='#DayFive' data-role='button'  style='display: block; margin: .25em; text-align: left;' data-transition='slide'>12/5/2012</a></li>"}
    ]

    The items appear in the list view, but they appear as just text. I am using a template to bound the field.
    I have searched the documentation and forums and have not found a potential solution.
    How can this be accomplished?


  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 31 Dec 2012 Link to this post

    Hello,

     How does your template look like? The #= # expression can be used to embed raw HTML without encoding it. You can find more info in the template overview help topic.

    Regards,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
Back to Top