Skip to content

Instantly share code, notes, and snippets.

@stlsmiths
Created March 14, 2012 19:52
Show Gist options
  • Save stlsmiths/2039032 to your computer and use it in GitHub Desktop.
Save stlsmiths/2039032 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>YUI DataTable Exercises</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
/* define your styles here */
</style>
</head>
<body class="yui3-skin-sam">
<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js" charset="utf-8"></script>
<!-- just define a template, locally ... won't execute anything .... -->
<script type="text/x-template" id="status-template">
Data Item One : <input type="text" value="{data_one}" />
Data Item Two : <input type="text" value="{data_two}" />
Data Item Three : <textarea>{data_three}</textarea>
</script>
<script type="text/javascript">
YUI().use( "panel", "other mods here", function(Y) {
// do your YUI stuff here ....
var mypanel = new Y.Panel( // .....);
mypanel.render();
var tmpl = Y.one("#status-template").getContent();
var filled_tmpl = Y.Lang.sub( tmpl, {
data_one : 'my values for one',
data_two : 'my values for two',
data_three : 'my values for Three in textarea'
});
mypanel.set('bodyContent',filled_tmpl);
mypanel.show();
});
</script>
<!-- other HTML markup stuff here -->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment