Kendo TreeView如何基于Jquery中的授权来选择模板
我有一个Kendo TreeView,它具有AuthorizationFlag(Y或N)来决定是使用Template1还是Template2。我该如何实现。 例如,如果我收到的响应为Y,则应该加载template1或Template2
<script id="template1" type="text/kendo-ui-template">
If Auth is Success
</script>
<script id="template2" type="text/kendo-ui-template">
If Auth is fail
</script>
答案 0 :(得分:0)
我想让Harsha pps顺服!
<script type="text/x-kendo-template" id="myTemplate">
#if(task.Auth== 'Y'){#
<div>If Auth is Success</div>
#}else{#
<div>If Auth is fail</div>
#}#
</script>
我假设授权Y / N在变量Auth
中请检查Teleriks example!