【发布时间】:2013-05-01 02:03:48
【问题描述】:
我是 knockoutjs 的新手 在我的项目中,我有报告列表。 当用户点击其中一个报告时, 下一个 div(ReportContentdiv) 应该显示所有 报表的子报表(SubReportName, SubReportDate, SubReportNote, SubReportType) 表格格式。 我不知道该怎么做。 非常感谢任何帮助
这是我的代码
@@@@@@
--HTML
<div id="ReportNamediv">
<ul class="ulclass">
<div data-bind="template: {name: 'ReportData',foreach:$root.Report}">
</div>
</ul>
</div>
<div id="ReportContentdiv">
//Show Report Content here
</div>
@@@@@@@@
--Script
<script type="text/html" id="ReportData">
<li><a href="#"><span data-bind="text: ReportName"></span></a></li>
</script>
【问题讨论】: