mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 21:13:26 +00:00
87 lines
2.8 KiB
HTML
87 lines
2.8 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
<head>
|
|
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
|
<title>Basic Example</title>
|
|
|
|
<style type="text/css">
|
|
/*margin and padding on body element
|
|
can introduce errors in determining
|
|
element position and are not recommended;
|
|
we turn them off as a foundation for YUI
|
|
CSS treatments. */
|
|
body {
|
|
margin:0;
|
|
padding:0;
|
|
}
|
|
</style>
|
|
|
|
<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
|
|
<link rel="stylesheet" type="text/css" href="../../build/datatable/assets/skins/sam/datatable.css" />
|
|
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
|
|
<script type="text/javascript" src="../../build/dragdrop/dragdrop-min.js"></script>
|
|
<script type="text/javascript" src="../../build/element/element-min.js"></script>
|
|
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
|
|
<script type="text/javascript" src="../../build/datatable/datatable-min.js"></script>
|
|
|
|
|
|
<!--begin custom header content for this example-->
|
|
<style type="text/css">
|
|
/* custom styles for this example */
|
|
.yui-skin-sam .yui-dt-liner { white-space:nowrap; }
|
|
</style>
|
|
|
|
<!--end custom header content for this example-->
|
|
|
|
</head>
|
|
|
|
<body class="yui-skin-sam">
|
|
|
|
|
|
<h1>Basic Example</h1>
|
|
|
|
<div class="exampleIntro">
|
|
<p>A demonstration of the DataTable's basic feature set.</p>
|
|
|
|
</div>
|
|
|
|
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
|
|
|
|
<div id="basic"></div>
|
|
|
|
<script type="text/javascript" src="assets/js/data.js"></script>
|
|
<script type="text/javascript">
|
|
YAHOO.util.Event.addListener(window, "load", function() {
|
|
YAHOO.example.Basic = function() {
|
|
var myColumnDefs = [
|
|
{key:"id", sortable:true, resizeable:true},
|
|
{key:"date", formatter:YAHOO.widget.DataTable.formatDate, sortable:true, sortOptions:{defaultDir:YAHOO.widget.DataTable.CLASS_DESC},resizeable:true},
|
|
{key:"quantity", formatter:YAHOO.widget.DataTable.formatNumber, sortable:true, resizeable:true},
|
|
{key:"amount", formatter:YAHOO.widget.DataTable.formatCurrency, sortable:true, resizeable:true},
|
|
{key:"title", sortable:true, resizeable:true}
|
|
];
|
|
|
|
var myDataSource = new YAHOO.util.DataSource(YAHOO.example.Data.bookorders);
|
|
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
|
|
myDataSource.responseSchema = {
|
|
fields: ["id","date","quantity","amount","title"]
|
|
};
|
|
|
|
var myDataTable = new YAHOO.widget.DataTable("basic",
|
|
myColumnDefs, myDataSource, {caption:"DataTable Caption"});
|
|
|
|
return {
|
|
oDS: myDataSource,
|
|
oDT: myDataTable
|
|
};
|
|
}();
|
|
});
|
|
</script>
|
|
|
|
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
|
|
|
|
</body>
|
|
</html>
|