Reputation: 139
I'am using Extjs4.2.2. In my application i am using three loops, after the first loop i want to declare a variable and inside each iteration of second loop i want to increment the value and use the value in a class of a div. I have tried in the following way
'<tpl for="this.resources">',
'{% var parentIndex = xindex; %}',
'<tpl for="slots">',
'<div class="ext-cal-bg-row resource-slots-allocation tapaswini-'+(parentIndex++)+'" ></div>', // here i want to add the incremented value of parentindex to the class name tapaswini
'</tpl></tpl>',
But its giving error to me . Even am unable to access the "parentIndex" value.
Can anybody suggest where I'am missing. Any help is highly appreciated
Thanks in advance Tapaswini
Upvotes: 0
Views: 917
Reputation: 139
I found the solution
'<tpl for="this.resources">',
'{% var parentIndex = xindex; %}',
'<tpl for="slots">',
'<div class="ext-cal-bg-row resource-slots-allocation tapaswini-{[parentIndex++]} " ></div>',
'</tpl></tpl>',
By this am able to increment the variable
Thanks Tapaswini
Upvotes: 1