Kendo UIテンプレート内で、各オブジェクト内のコレクションをループしてページ上の情報をレンダリングする方法をリストビューで理解しようとしています。これが私が遊んでいるjsonの例です:
{"Data":[{"Title":"Malicious Acts","KeyPairs":{"Key1":"12","Key2":"24"}}, {"Title":"Enrollments","KeyPairs":{"Key1":"12","Key2":"24"}},{"Title":"Customer Feedback","KeyPairs":{"Key1":"12","Key2":"24"}},{"Title":"Questionable Accounts","KeyPairs":{"Key1":"12","Key2":"24"}}],"Total":4,"AggregateResults":null,"Errors":null}
テンプレートにKeyPairsアイテムをレンダリングしたいのですが、その方法を理解するのに少し問題があります。
ソースは次のとおりです。
<div id="subscriberFunctions">
<script type="text/x-kendo-tmpl" id="template">
<div class="subscriberFunction">
<h3>${Title}</h3>
<!-- Display KeyPairs -->
</div>
</script>
@(Html.Kendo().ListView<SubscriberMenuFunction>()
.Name("listView")
.TagName("div")
.ClientTemplateId("template")
.DataSource(dataSource =>
{
dataSource.Read(read => read.Action("SubscriberMenu", "ListView"));
})
.Selectable(selectable => selectable.Mode(ListViewSelectionMode.Single))
)
</div>
私はこれを考えすぎていると確信しています。これは単純なことですが、KendoUIがそれを認識するためにテンプレートにforeachループを実装する方法がわかりません。
前もって感謝します!