Pass variables to child template

30 views
Skip to first unread message

Fer van Rijswijk

unread,
Jun 23, 2015, 4:41:21 AM6/23/15
to knock...@googlegroups.com
I want to pass a variable to a child template.

In the code below i have a template in which is $parent.clickableRows known. I want this variabel be available when in the handler of each <tr>

see code below


<div data-bind="attr: { class: 'bq-table ' + presentationStyles().joined,
 clickableRows: $parent.clickableRows },
 bqMode: ['fieldValueOnly']"
>
 
<!-- ko if: properties().limitmessage -->
 
<div class="alert" data-bind="text: properties().limitmessage"></div>
 
<!-- /ko -->
 
<table class="table table-striped">
 
<thead data-bind="if: header">
 
<tr data-bind="foreach: header.children">
 
<!-- ko template: { name: template } --><!-- /ko -->
 
</tr>
 
</thead>
 
<tbody data-bind="foreach: rows">
 
<tr data-bind="tablerow: $parent.isClickable, foreach: children">
 
<!-- ko template: { name: template} --><!-- /ko -->
 
</tr>
 
</tbody>
 
</table>
</div>



Reply all
Reply to author
Forward
0 new messages