Accessing parent context in template7 loop
This is a (multiple allowed):
-
[x] bug
-
Framework7 Version: 1.6.4
-
Platform and Target: CORDOVA ANDROID
What you did
I was trying to access the parent context of a nested loop. This is the template´s context
[
{
"name": "Parent",
"childs": [
{
"name": "Child"
}]
}]
And this is the template
{{#each this}}
{{#childs}}
<li>{{../name}}</div>
</li>
{{/child}}
{{/each}}
I am working with this options: template7Pages: true precompileTemplates: true
Expected Behavior
I wanted to render parent´s name
Actual Behavior
It rendered child´s name, no matter how many ../ I prepended I´m guessing the trigger() function I had to use is responsible
Any updates ?
Hmm... this works:
{{#each OpenOrders}}
<tr>
<td class="tablet-only">{{description}} {{../Id}}</td>
</tr>
{{/each}}
but this not:
{{#each OpenOrders}}
<tr>
<td class="tablet-only">
{{#if ../IAmWorking}}
<td class="tablet-only">{{description}} {{../Id}}</td>
{{else}}
<td class="tablet-only">
<a class="link icon-only" title="Auftrag abarbeiten" onclick="CompanyStartProcessing({{../Id}},{{id}})"><i class="icon f7-icons">fastforward_round</i></a></td>
{{/if}}
</tr>
{{/each}}
in second code {{../Id}} inside the #if is empty. Seems to be tied to the #if nesting.
Additon: onclick="CompanyStartProcessing({{@root.Id}},{{id}})"
works inside the #if block
URL: http://truemoney.com/vascashback50 เซิร์ฟเวอร์: sgp1-MIUI-l7-sec06.awssgp วันที่: 2017/11/12 02:33:08
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.