This is a migrated thread and some comments may be shown as answers.

Creating href items in ListView from json feed

1 Answer 61 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 29 Dec 2012, 10:47 PM
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?


1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 31 Dec 2012, 10:36 AM
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!
Tags
ListView (Mobile)
Asked by
Scott
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or