Extjs4.2 如何在Xtemplate中为每次迭代在for循环中声明变量和增量
我正在使用Extjs4.2.2。在我的应用程序中,我使用了三个循环,在第一个循环之后,我想声明一个变量,在第二个循环的每次迭代中,我想增加值,并在一个div类中使用值Extjs4.2 如何在Xtemplate中为每次迭代在for循环中声明变量和增量,extjs4.2,Extjs4.2,我正在使用Extjs4.2.2。在我的应用程序中,我使用了三个循环,在第一个循环之后,我想声明一个变量,在第二个循环的每次迭代中,我想增加值,并在一个div类中使用值 '<tpl for="this.resources">', '{% var parentIndex = xindex; %}', '<tpl for="slots">', '<div class="ext-cal-bg-row resou
'<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>',
”,
“{%var parentIndex=xindex;%}”,
'',
“”,//这里我想将parentindex的递增值添加到类名tapaswini中
'',
但这给了我错误。甚至我也无法访问“parentIndex”值
有人能告诉我我失踪的地方吗。非常感谢您的帮助
提前谢谢
Tapaswini我找到了解决方案
'<tpl for="this.resources">',
'{% var parentIndex = xindex; %}',
'<tpl for="slots">',
'<div class="ext-cal-bg-row resource-slots-allocation tapaswini-{[parentIndex++]} " ></div>',
'</tpl></tpl>',
”,
“{%var parentIndex=xindex;%}”,
'',
'',
'',
这样我就可以增加变量
谢谢
塔帕斯维尼