Created
February 1, 2013 20:08
-
-
Save stan229/4693757 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tpl = new Ext.XTemplate( | |
'<p>Name: {name}</p>', | |
'<p>Kids: ', | |
'<tpl for="kids">', | |
'<tpl if="this.isGirl(name)">', | |
'<p>Girl: {name} - {age}</p>', | |
'<tpl else>', | |
'<p>Boy: {name} - {age}</p>', | |
'</tpl>', | |
'<tpl if="this.isBaby(age)">', | |
'<p>{name} is a baby!</p>', | |
'</tpl>', | |
'</tpl></p>', | |
{ | |
// XTemplate configuration: | |
disableFormats: true, | |
// member functions: | |
isGirl: function(name){ | |
return name == 'Sara Grace'; | |
}, | |
isBaby: function(age){ | |
return age < 1; | |
} | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment