0
我有以下模板:EXTJS4 XML存儲 - XTemplate
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個「測試」版本。謝謝