Jquery jTemplates中的局部变量/for循环

Jquery jTemplates中的局部变量/for循环,jquery,jtemplates,Jquery,Jtemplates,可以在jtemplate中创建局部变量或for循环(而不是foreach)吗?我想给HTML元素提供唯一的id,需要一个计数器之类的东西。谢谢 使用$index $index - index of the element in the table $iteration - ID of the iteration (the next number begins from 0) $first - is this the first iteration? $last - is this the las

可以在jtemplate中创建局部变量或for循环(而不是foreach)吗?我想给HTML元素提供唯一的id,需要一个计数器之类的东西。谢谢

使用
$index

$index - index of the element in the table
$iteration - ID of the iteration (the next number begins from 0)
$first - is this the first iteration?
$last - is this the last iteration?
$total - the total number of iterations


阅读使用
$index

$index - index of the element in the table
$iteration - ID of the iteration (the next number begins from 0)
$first - is this the first iteration?
$last - is this the last iteration?
$total - the total number of iterations


雷德工作出色。非常感谢你!工作出色。非常感谢你!