首页 > 其他 > 详细

分享一些关于KnockOut的语法,绑定Tree

时间:2016-06-14 15:58:26      阅读:537      评论:0      收藏:0      [点我收藏+]
<ul class="ak-ps-tree-conul">
<!-- ko foreach:$root.List-->
<!-- ko if:1==1 -->
<li class="pstree-node pstree-closed">
<!-- ko if:ChildItem().length>
0 -->
<i class="ps-treeicon" data-bind="click: OpenThisNode"></i>
<!-- /ko -->
<!-- ko if:ChildItem().length==0 -->
<i class="ps-treeicon empty"></i>
<!-- /ko -->
<a href="javascript:void(0)" class="pstree-anchor" data-bind="text: Name,click:clickThisData"></a>
<!-- ko if:ChildItem().length>
0 -->
<!-- ko template: { name: Template, foreach: ChildItem } -->
<!-- /ko -->
<!-- /ko -->
</li>
<!-- /ko -->
<!-- /ko -->
</ul>

<script type="text/html" id="Template">
<ul class="pstree-children">
<li class="pstree-node pstree-closed">
<!-- ko if:ChildItem().length>0 -->
<i class="ps-treeicon" data-bind="click: OpenThisNode"></i>
<!-- /ko -->
<!-- ko if:ChildItem().length==0 -->
<i class="ps-treeicon empty"></i>
<!-- /ko -->
<a href="javascript:void(0)" class="pstree-anchor" data-bind="text: Name,click:clickThisData"></a>
<!-- ko if:ChildItem().length>0 -->
<!-- ko template: { name: Template, foreach: ChildItem } -->
<!-- /ko -->
<!-- /ko -->
</li>
</ul>
</script>

 

分享一些关于KnockOut的语法,绑定Tree

原文:http://www.cnblogs.com/Z--BO/p/5584003.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!