Created
October 19, 2010 10:11
-
-
Save nelstrom/633960 to your computer and use it in GitHub Desktop.
Creating an XTemplate from the innerHTML of a <textarea> element.
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
<!DOCTYPE html> | |
<html> | |
<head>...[load sencha js/css etc.]...</head> | |
<body> | |
<textarea id="kids-list" class="x-hidden-display"> | |
<p>Kids:</p> | |
<tpl for="."> | |
<p>{#}. {name}</p> | |
</tpl> | |
</textarea> | |
</body> | |
</html> |
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
Ext.setup({ | |
onReady: function() { | |
var data = [{ | |
name: 'Joshua', | |
age:3 | |
},{ | |
name: 'Matthew', | |
age:2 | |
},{ | |
name: 'Solomon', | |
age:0 | |
} | |
]; | |
var content = new Ext.Panel({ | |
tpl: Ext.XTemplate.from(Ext.get("kids-list")) | |
}); | |
new Ext.Panel({ | |
fullscreen: true, | |
items: [content] | |
}); | |
content.update(data); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment