Extjs 4.1.1如何调试Xtemplete

Anu*_*nup 3 extjs4.1

我使用的是Ext 4.1.1版本.

我想知道如何调试Xtemplate.即,例如

 '<tpl for="outerObject">',
     '<tpl for="innerObject">',
          '<span class="abc">{myValue}</span>',
     '</tpl>',
 '</tpl>',
Run Code Online (Sandbox Code Playgroud)

现在我想知道Value outerObject的含义,具体取决于想要循环到innerObject的内容,依此类推.

请告诉我任何降低Xtemplate的方法.

Mol*_*Man 6

您可以在XTemplate中执行任意内联代码.因此,您可以调用console.log以打印一些对象变量:

'{[console.log(values.outerObject)]}',
Run Code Online (Sandbox Code Playgroud)


Tom*_*ber 6

最简单的方法是进入浏览器的调试器:

tpl: [
'<tpl for="outerObject">',
     '{% debugger; %}'
     '<tpl for="innerObject">',
          '<span class="abc">{myValue}</span>',
     '</tpl>',
'</tpl>'
]
Run Code Online (Sandbox Code Playgroud)