我想做这样的事情http://jsfiddle.net/kfEfw/115/ 但是在 kendo.template( .... ) 我想检查一个变量的值。在具体示例中,它无法识别 x 变量,我想知道是否有办法在模板中传递 x。
var temp = 0; //i want to pass this variable in the template and check it's value
/if temp = 0 I need to render sth and if temp has other value I want to render sth else
window.kendouiTemplate = kendo.template("<div><h1 class='header'><#= data.header#></h1><ul
class='list'><# for (var i = 0, l = data.list.length; i < l; i++) {
#><#if(data.list[i]%2==0){#><li class='item'><#= data.list[i] #></li><#}#><# } #></ul>
</div>", {useWithBlock:false});
在此先感谢,阿尔忒弥斯