我有以下模板:
myStore.on('load', function(store, records, options) {
console.log(records);
alert("loaded.");
var tpl = new Ext.XTemplate(
'<tpl for=".">',
'<h1>{name} test</h1>',
'<h1>{origin}</h1>',
'</tpl>'
);
tpl.append(Ext.get("output-body"), myStore);
});
它遍历我的商店,其中有 3 条记录:
accounts { id="accounts-ext-record-1", internalId="ext-record-1"}
name = "Network" origin = "Support_4" id = undefined
accounts { id="accounts-ext-record-2", internalId="ext-record-2"}
name = "new" origin = "nevil-nmshub" id = undefined
accounts { id="accounts-ext-record-3", internalId="ext-record-3"}
name = "soap" origin = "network" id = undefined
当我运行代码时,我得到:
test
test
test
输出“名称”和“原点”的值我缺少什么?某些东西正在发挥作用,因为它很明显地看到了 3 个帐户,因此出现了 3 个“测试”打印件。谢谢