Thank you for reporting this bug. We will make it our priority to review this report.
-
Sencha User
Calling function inside template causes XTemplate exception
I have a code the calls a javascript function inside an template, but when testing the code it produces an error below...
[W] XTemplate evaluation exception: age is not defined
The code below is a simplified version but still produces the error.
Need help.
Thanks!
PHP Code:
var team = Ext.create({
xtype: 'dataview',
fullscreen: true,
store: [
{ name: 'Peter', age: 26 },
{ name: 'Ray', age: 21 },
{ name: 'Egon', age: 24 },
{ name: 'Winston', age: 24 }
],
itemTpl: [ '<div>{name} is {[this.callMe(age)]} years old</div>', {
disableFormats: true,
callMe: function( val ){
return 'Test';
}
} ]
});
UPDATE: Stupid me... i forgot to put "values" before the variable name... so it should have been "values.age".
Please close.
Thanks!