码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-06-14 15:59:08      阅读:146      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!