webgui/www/extras/yui/examples/datatable/dt_fixedscroll_clean.html
2008-03-25 16:13:25 +00:00

117 lines
No EOL
4.2 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>XY-scrolling, Y-scrolling, and X-scrolling</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/button/assets/skins/sam/button.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/element/element-beta-min.js"></script>
<script type="text/javascript" src="../../build/button/button-min.js"></script>
<script type="text/javascript" src="../../build/datasource/datasource-beta-min.js"></script>
<script type="text/javascript" src="../../build/datatable/datatable-beta-min.js"></script>
<!--there is no custom header content for this example-->
</head>
<body class=" yui-skin-sam">
<h1>XY-scrolling, Y-scrolling, and X-scrolling</h1>
<div class="exampleIntro">
<p>Scrolling can be enabled on a DataTable along the x, y, or xy-axes. Set the
DataTable's "scrollable" value to "true", and set a width and/and or height string
values.</p>
</div>
<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->
<h2 class="first">XY Scrolling</h2>
<div id="xyscrolling"></div>
<h2>Y Scrolling</h2>
<div id="yscrolling"></div>
<h2>X Scrolling</h2>
<div id="xscrolling"></div>
<script type="text/javascript" src="assets/js/data.js"></script>
<script type="text/javascript">
YAHOO.util.Event.addListener(window, "load", function() {
YAHOO.example.Scrolling = new function() {
var myColumnDefs = [
{key:"field1", width:50},
{key:"field2", width:100, formatter:"date"},
{key:"field3", width:50},
{key:"field4", width:50},
{key:"field5", width:50},
{key:"field6", width:150}
];
var myColumnDefsY = [
{key:"field1", width:50},
{key:"field2", width:100, formatter:"date"},
{key:"field3", width:50},
{key:"field4", width:50},
{key:"field5", width:50},
{key:"field6", width:150}
];
var myColumnDefsX = [
{key:"field1", width:50},
{key:"field2", width:100, formatter:"date"},
{key:"field3", width:50},
{key:"field4", width:50},
{key:"field5", width:50},
{key:"field6", width:150}
];
this.myDataSource = new YAHOO.util.DataSource(YAHOO.example.Data.multitypes);
this.myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
this.myDataSource.responseSchema = {
resultsList: "items",
fields: [
{key:"field1"},
{key:"field2", formatter:"date"},
{key:"field3"},
{key:"field4"},
{key:"field5"},
{key:"field6"}
]
};
// Set "scrollable:true" and set width and height string values
this.myDataTableXY = new YAHOO.widget.DataTable("xyscrolling", myColumnDefs,
this.myDataSource, {scrollable:true, width:"30em", height:"10em"});
// Set "scrollable:true" and set only height string value
this.myDataTableY = new YAHOO.widget.DataTable("yscrolling", myColumnDefsY,
this.myDataSource, {scrollable:true, height:"10em"});
// Set "scrollable:true" and set only width string value
this.myDataTableX = new YAHOO.widget.DataTable("xscrolling", myColumnDefsX,
this.myDataSource, {scrollable:true, width:"30em"});
};
});
</script>
<!--END SOURCE CODE FOR EXAMPLE =============================== -->
</body>
</html>