I have some Ajax data in a store that resembles this format:
...and so on. I've got a DataView and I'm trying to run through the tests array, displaying only the tests with the same courseID as the course in which it is located. Here's my DataView tpl, which isn't working:
Is there a way to create a conditional statement that compares a value with a parent value?
Get Parent Values in an XTemplate Conditional Statement
Code:
{
"courses":[
{
"courseID":"1",
"courseName":"Math",
"tests":[
{
"testID":"1",
"testName":"Ye Old Math Test",
"courseID":"1",
"courseName":"Math",
"testType":"Test"
...and so on. I've got a DataView and I'm trying to run through the tests array, displaying only the tests with the same courseID as the course in which it is located. Here's my DataView tpl, which isn't working:
Code:
<tpl for="tests">
<tpl if="courseID == parent.courseID"> //<-- This is not working
<div>Test Name: {testName} ({courseID}{parent.courseID})</div>
</tpl>
</tpl>
Is there a way to create a conditional statement that compares a value with a parent value?
Get Parent Values in an XTemplate Conditional Statement
Aucun commentaire:
Enregistrer un commentaire