-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
Question: Who has an idea how i can get a parent $index value inside a child $repeat?
as in a html structure like
<node class="cluster"> // first repeat - thinks rows
<node class="particle"></node> // second repeat -- think columns
</node>
and .js
behaviors: {
.cluster': {
'$repeat': function(s_array) {
var result = [];
for (var i = 0; i < s_array.length; i++) { result.push({}); }
return result;
},
'position': function($index)
return [ s_array[$index][1], ];
},
},
'.particle': {
'$repeat': function(s_array) {
var result = [];
for (var i = 0; i < s_array[PARENTINDEX][2]; i++) { result.push({}); }
return result;
},
'position': function() {
return [$index, 0];
},
},
states: {
s_array : [[1,11,8],[2,9,13],[2,9,23],[3,7,13],[4,6,19],[5,5,19],[6,4,8],[6,19,5],[7,4,7],[7,21,2],[8,4,6]]
}
Metadata
Metadata
Assignees
Labels
No labels