Skip to content

Instantly share code, notes, and snippets.

@davidecavaliere
Created May 17, 2013 22:14
Show Gist options
  • Save davidecavaliere/5602338 to your computer and use it in GitHub Desktop.
Save davidecavaliere/5602338 to your computer and use it in GitHub Desktop.
Full working example of aui-datatable
<div id="myDataTable"></div>
<script src="http://cdn.alloyui.com/1.7.0/aui/aui-min.js"></script>
<script>
AUI({
modules: {
'bootstrap': {
fullpath: 'http://alloyui.com/versions/1.7.x/website/css/bootstrap.css',
type: 'css'
},
'basic': {
fullpath: 'http://alloyui.com/versions/1.7.x/datatable/css/basic.css',
type: 'css',
},
'aui-skin-classic': {
fullpath: 'http://cdn.alloyui.com/1.7.0/aui-skin-classic/css/aui-skin-classic-all-min.css',
type: 'css',
}
}
}).use(
'aui-datatable', 'bootstrap', 'basic', 'aui-skin-classic',
function(A) {
var columns = ['name', 'age'];
var data = [
{name: 'Bob', age: '28'},
{name: 'Joe', age: '72'},
{name: 'Sarah', age: '35'}
];
new A.DataTable(
{
columns: columns,
data: data
}
).render('#myDataTable');
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment