当用户单击联系人标题时,我想显示一个模式。我有一个包含 50 个联系人的数组,我正在显示所有元素:
Natha Delarue
CEO Sikka
sikka@mail.com(work)
+33 5 99 31 86 36 (work)
Sikka.com (work)
http://sikka.com (work)
Paul kalbernner
...
我想当我单击联系人标题(姓名,名字)以加载模式以打印其他内容(例如签名,推特...)
这是我的代码:模态:
<div class="modal fade hide" data-bind="modal: viewModel.ui.FlashbackReport.selected">
<div class="modal-header">
<button class="close" data-dismiss="modal">x</button>
<h3>Edit Record</h3>
</div>
<div class="modal-body">
<div> Contenu signature </div>
</div>
</div>
显示所有信息:
<div id="retrievedContactsDiv" data-bind="foreach: viewModel.MoreContacts.contacts()">
<a href="#" data-bind="text: $data.contactTitle(), click: viewModel.ui.FlashbackReport.selected"></a>
<!-- ko foreach: $data.organizations() -->
.......
<!-- ko foreach: $data.emails() -->
.....
选定的初始化
viewModel.ui.FlashbackReport = {
selected: ko.observable(), }