<!doctype html>
<head>
<meta charset="utf-8">
<title>Test Page</title>
body {
xbackground: #000;
font-family: arial, sans-serif;
font-size: 13px;
}
#log {
background: #fff;
position: absolute;
top: 10px;
right: 10px;
width: 300px;
border: 2px ridge;
padding: 10px;
}
#log p {
margin: 1em 0;
}
</style>
</head>
<body>
<button id="add">Add a row</button>
<button id="remove">Remove a row</button>
<button id="modify">Modify a row</button>
<button id="addcol">Add a column</button>
<button id="removecol">Remove a column</button>
<button id="modifycol">Modify a column</button>
<button id="modifywidth">Modify width</button>
<button id="sort">Sort</button>
<button id="showmessage">Show Message</button>
<button id="hidemessage">Hide Message</button>
<button id="sync">syncUI</button>
<button id="scrollable">Toggle scrollable</button>
<!--div id="log"></div-->
<div class="wrapper yui3-skin-sam">
<div id="x"></div>
</div>
<p>
This is some content below the table.
</p>
<!--script src="http://yui.yahooapis.com/3.4.1/build/yui/yui.js"></script-->
<!--script src="http://yui.yahooapis.com/3.5.0pr4/build/yui/yui.js"></script-->
<script>
YUI({
filters: {
'datatable-scroll': 'debug'
},
filter: 'raw'
}).use(
'datatable-scroll', 'datatable-sort', 'datatable-mutable',
'datatable-message',
'datasource-io', 'datatable-datasource', 'datasource-jsonschema',
function (Y) {
var data = [], i;
for (i = 0; i < 10; ++i) {
});
}
data[1].eggs = data[1].fennel = data[1].guacamole = '';
var start = new Date();
data: data,
scrollable: 'xy',
//width: '100%',
//width: '750px',
width: '500px',
height: '250px',
//autoSync: true,
sortable: true,
//sortable: ['carrots'],
caption: 'Can you hear the caption?',
sortBy: [{ apples: 'desc' }],
columns: [
{
key: 'apples',
label: 'Apples',
//headerTemplate: '<th class="{className}" rowspan="{_rowspan}" colspan="{_colspan}" scope="col"><strong>{content}</strong></th>',
//cellTemplate: '<th class="{className}" scope="row">{content}</th>',
allowHTML: true,
width: '150px',
sortFn: function (a, b, desc) {
order = (a > b) ? 1 : (a < b) ? -1 : 0;
return desc ? -order : order;
},
sortDir: -1
},
{ label: "Parent of B and C", children: [
{ key: 'bananas' },
{ key: 'carrots' }
]},
{ label: "Parent of D through G", children: [
{ label: 'Parent of D and E', children: [
{ key: 'daikon' },
{ key: 'eggs', xwidth: '200px' }
]},
{ label: 'Parent of F and G', children: [
'fennel', 'guacamole'
]}
]}
]
});
var milestone = new Date();
}, '.yui3-datatable-data tr');
/*
source: "data.php?fields=author,title"
}).plug(Y.Plugin.DataSourceJSONSchema, {
schema: {
resultListLocator: 'records',
resultFields: ['author', 'title']
}
})
});
*/
/*
});
*/
table.render('#x');
apples: 'Jan Comstock',
bananas: '1234',
carrots: 'The Diaries of Phil Collins',
daikon: 'What?',
eggs: 'scrambled',
fennel: 'raw, 2tbsp',
guacamole: 'For the chips!'
});
});
table.removeRow(0);
});
});
key: 'apples',
formatter: function (o) {
}
});
});
});
}});
});
unit = (''+width).replace(/[0-9]/g, '');
});
});
table.showMessage('loadingMessage');
});
});
table.syncUI();
});
var scrollable = {
x: 'xy',
y: 'x',
xy: false
},
current = table.get('scrollable');
});
});
</script>
</body>
</html>