First Initial

This commit is contained in:
Nakorn Rientrakrunchai
2020-02-20 15:02:39 +07:00
commit 8b98125e49
3048 changed files with 760804 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
/*
* Namespace: DTS (DataTables Scroller)
*/
div.DTS tbody th,
div.DTS tbody td {
white-space: nowrap;
}
div.DTS tbody tr.even {
background-color: white;
}
div.DTS div.DTS_Loading {
position: absolute;
top: 50%;
left: 50%;
width: 200px;
height: 20px;
margin-top: -20px;
margin-left: -100px;
z-index: 1;
border: 1px solid #999;
padding: 20px 0;
text-align: center;
background-color: white;
background-color: rgba(255, 255, 255, 0.5);
}
div.DTS div.dataTables_scrollHead {
background-color: white;
}
div.DTS div.dataTables_scrollBody {
z-index: 2;
}
div.DTS div.dataTables_scroll {
background: url('../images/loading-background.png') repeat 0 0;
}

View File

@@ -0,0 +1,174 @@
<?php
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Easy set variables
*/
/* Array of database columns which should be read and sent back to DataTables. Use a space where
* you want to insert a non-database field (for example a counter or static image)
*/
$aColumns = array( 'id', 'firstname', 'surname', 'zip', 'country' );
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "id";
/* DB table to use */
$sTable = "massive";
/* Database connection information */
$gaSql['user'] = "";
$gaSql['password'] = "";
$gaSql['db'] = "";
$gaSql['server'] = "localhost";
/* REMOVE THIS LINE (it just includes my SQL connection user/pass) */
include( $_SERVER['DOCUMENT_ROOT']."/datatables/mysql.php" );
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* If you just want to use the basic configuration for DataTables with PHP server-side, there is
* no need to edit below this line
*/
/*
* MySQL connection
*/
$gaSql['link'] = mysql_pconnect( $gaSql['server'], $gaSql['user'], $gaSql['password'] ) or
die( 'Could not open connection to server' );
mysql_select_db( $gaSql['db'], $gaSql['link'] ) or
die( 'Could not select database '. $gaSql['db'] );
/*
* Paging
*/
$sLimit = "";
if ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )
{
$sLimit = "LIMIT ".mysql_real_escape_string( $_GET['iDisplayStart'] ).", ".
mysql_real_escape_string( $_GET['iDisplayLength'] );
}
/*
* Ordering
*/
$sOrder = "";
if ( isset( $_GET['iSortCol_0'] ) )
{
$sOrder = "ORDER BY ";
for ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )
{
if ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == "true" )
{
$sOrder .= $aColumns[ intval( $_GET['iSortCol_'.$i] ) ]."
".mysql_real_escape_string( $_GET['sSortDir_'.$i] ) .", ";
}
}
$sOrder = substr_replace( $sOrder, "", -2 );
if ( $sOrder == "ORDER BY" )
{
$sOrder = "";
}
}
/*
* Filtering
* NOTE this does not match the built-in DataTables filtering which does it
* word by word on any field. It's possible to do here, but concerned about efficiency
* on very large tables, and MySQL's regex functionality is very limited
*/
$sWhere = "";
if ( isset($_GET['sSearch']) && $_GET['sSearch'] != "" )
{
$sWhere = "WHERE (";
for ( $i=0 ; $i<count($aColumns) ; $i++ )
{
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string( $_GET['sSearch'] )."%' OR ";
}
$sWhere = substr_replace( $sWhere, "", -3 );
$sWhere .= ')';
}
/* Individual column filtering */
for ( $i=0 ; $i<count($aColumns) ; $i++ )
{
if ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == "true" && $_GET['sSearch_'.$i] != '' )
{
if ( $sWhere == "" )
{
$sWhere = "WHERE ";
}
else
{
$sWhere .= " AND ";
}
$sWhere .= $aColumns[$i]." LIKE '%".mysql_real_escape_string($_GET['sSearch_'.$i])."%' ";
}
}
/*
* SQL queries
* Get data to display
*/
$sQuery = "
SELECT SQL_CALC_FOUND_ROWS ".str_replace(" , ", " ", implode(", ", $aColumns))."
FROM $sTable
$sWhere
$sOrder
$sLimit
";
$rResult = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
/* Data set length after filtering */
$sQuery = "
SELECT FOUND_ROWS()
";
$rResultFilterTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
$aResultFilterTotal = mysql_fetch_array($rResultFilterTotal);
$iFilteredTotal = $aResultFilterTotal[0];
/* Total data set length */
$sQuery = "
SELECT COUNT(".$sIndexColumn.")
FROM $sTable
";
$rResultTotal = mysql_query( $sQuery, $gaSql['link'] ) or die(mysql_error());
$aResultTotal = mysql_fetch_array($rResultTotal);
$iTotal = $aResultTotal[0];
/*
* Output
*/
$output = array(
"sEcho" => intval($_GET['sEcho']),
"iTotalRecords" => $iTotal,
"iTotalDisplayRecords" => $iFilteredTotal,
"aaData" => array()
);
while ( $aRow = mysql_fetch_array( $rResult ) )
{
$row = array();
for ( $i=0 ; $i<count($aColumns) ; $i++ )
{
if ( $aColumns[$i] == "version" )
{
/* Special output formatting for 'version' column */
$row[] = ($aRow[ $aColumns[$i] ]=="0") ? '-' : $aRow[ $aColumns[$i] ];
}
else if ( $aColumns[$i] != ' ' )
{
/* General output */
$row[] = $aRow[ $aColumns[$i] ];
}
}
$output['aaData'][] = $row;
}
echo json_encode( $output );
?>

View File

@@ -0,0 +1,337 @@
<!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>Class: Scroller - documentation</title>
<style type="text/css" media="screen">
@import "media/css/doc.css";
@import "media/css/shCore.css";
@import "media/css/shThemeDataTables.css";
</style>
<script type="text/javascript" src="media/js/shCore.js"></script>
<script type="text/javascript" src="media/js/shBrushJScript.js"></script>
<script type="text/javascript" src="media/js/jquery.js"></script>
<script type="text/javascript" src="media/js/doc.js"></script>
</head>
<body>
<div class="fw_container">
<a name="top"></a>
<div class="fw_header">
<h1 class="page-title">Class: Scroller</h1>
<div class="page-info">
Scroller v1.1.0 documentation
</div>
</div>
<div class="fw_nav">
<h2>Navigation</h2>
<ul>
<li><a href="#top">Overview</a></li>
<li><a href="#summary">Summary</a><div><table cellpadding="5" border="0" cellspacing="0" width="100%"><tbody><tr><td>Classes (0)</td><td><a href="#summary_namespaces">Namespaces (3)</a></td></tr><tr><td><a href="#summary_properties">Properties (1)</a></td><td><a href="#summary_properties_static">Static properties (1)</a></td></tr><tr><td><a href="#summary_methods">Methods (4)</a></td><td>Static methods (0)</td></tr><tr><td>Events (0)</td><td></td></tr></tbody></table></div></li><li><a href="#details">Details</a><div><table cellpadding="5" border="0" cellspacing="0" width="100%"><tbody><tr><td><a href="#summary_properties">Properties (1)</a></td><td><a href="#summary_properties_static">Static properties (1)</a></td></tr><tr><td><a href="#summary_methods">Methods (4)</a></td><td>Static methods (0)</td></tr><tr><td>Events (0)</td><td></td></tr></tbody></table></div></li></ul>
<div style="margin-top: 10px;">
<input type="hidden" name="show_private" value="0">
<span id="private_label">Hiding</span> private elements
(<a id="private_toggle" href="">toggle</a>)
</span>
</div>
<div>
<input type="hidden" name="show_extended" value="1">
<span id="extended_label">Showing</span> extended elements
(<a id="extended_toggle" href="">toggle</a>)
</span>
</div>
</div>
<div class="fw_content">
<a name="overview"></a>
<div class="doc_overview">
<div class="nav_blocker"></div>
<dl><dt id="Scroller" class=" even"><a name="Scroller"></a><a name="Scroller_details"></a><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a>new Scroller</a></span><span class="type-sig"><span class="signature">(oDT, <span class="optional">oOpts</span>)</span><span class="type-signature"></span></span></span></dt><dd class=" even"><p>Scroller is a virtual rendering plug-in for DataTables which allows large
datasets to be drawn on screen every quickly. What the virtual rendering means
is that only the visible portion of the table (and a bit to either side to make
the scrolling smooth) is drawn, while the scrolling container gives the
visual impression that the whole table is visible. This is done by making use
of the pagination abilities of DataTables and moving the table around in the
scrolling container DataTables adds to the page. The scrolling container is
forced to the height it would be for the full table display using an extra
element. </p>
<p>Note that rows in the table MUST all be the same height. Information in a cell
which expands on to multiple lines will cause some odd behaviour in the scrolling.</p>
<p>Scroller is initialised by simply including the letter 'S' in the sDom for the
table you want to have this feature enabled on. Note that the 'S' must come
AFTER the 't' parameter in sDom.</p>
<p>Key features include:
<ul class="limit_length">
<li>Speed! The aim of Scroller for DataTables is to make rendering large data sets fast</li>
<li>Full compatibility with deferred rendering in DataTables 1.9 for maximum speed</li>
<li>Correct visual scrolling implementation, similar to "infinite scrolling" in DataTable core</li>
<li>Integration with state saving in DataTables (scrolling position is saved)</li>
<li>Easy to use</li>
</ul></p><div class="collapse_details"><h3>Constructor</h3><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">oDT</td><td class="type type-param">object</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>DataTables settings object</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">oOpts</td><td class="type type-param">object</td><td class="attributes">Optional</td><td class="default">{}</td><td class="description last"><p>Configuration object for FixedColumns. Options are defined by <a href="Scroller.oDefaults.html">Scroller.oDefaults</a></p></td></tr>
</tbody>
</table><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready(function() {
$('#example').dataTable( {
"sScrollY": "200px",
"sAjaxSource": "media/dataset/large.txt",
"sDom": "frtiS",
"bDeferRender": true
} );
} );</pre>
</div>
</div>
</dl><h3 class="subsection-title">Requires</h3>
<ul>
<li>module:jQuery</li><li>module:DataTables</li>
</ul>
</div>
<div class="doc_summary">
<a name="summary"></a>
<h2>Summary</h2>
<div class="doc_group"><a name="summary_namespaces"></a><h3 class="subsection-title">Namespaces</h3>
<dl>
<dt class="even"><span class="type-name"><a href="c6053fac6b.html">dom</a></span></dt><dd class="even"><p>DOM elements used by the class instance</p></dd><dt class="odd"><span class="type-name"><a href="Scroller.oDefaults.html">oDefaults</a></span></dt><dd class="odd"><p>Scroller default settings for initialisation</p></dd><dt class="even"><span class="type-name"><a href="baed189d4a.html">s</a></span></dt><dd class="even"><p>Settings object which contains customisable information for the Scroller instance</p></dd>
</dl></div><div class="doc_group"><a name="summary_properties"></a><h3 class="subsection-title">Properties - instance</h3>
<dl>
<dt class=" even"><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a href="#CLASS">CLASS</a></span><span class="type-sig"><span class="type-signature"> :String</span></span></dt><dd class=" even"><p>Name of this class</p></dd>
</dl></div><div class="doc_group"><a name="summary_properties_static"></a><h3 class="subsection-title">Properties - static</h3>
<dl>
<dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#VERSION">VERSION</a></span><span class="type-sig"><span class="type-signature"> :String</span></span></dt><dd class=" even"><p>Scroller version</p></dd>
</dl></div><div class="doc_group"><a name="summary_methods"></a><h3 class="subsection-title">Methods - instance</h3>
<dl>
<dt class=" even"><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a href="#fnMeasure">fnMeasure</a></span><span class="type-sig"><span class="signature">(<span class="optional">bRedraw</span>)</span><span class="type-signature"> &rarr; {void}</span></span></dt><dd class=" even"><p>Calculate and store information about how many rows are to be displayed in the scrolling
viewport, based on current dimensions in the browser's rendering. This can be particularly
useful if the table is initially drawn in a hidden element - for example in a tab.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a href="#fnPixelsToRow">fnPixelsToRow</a></span><span class="type-sig"><span class="signature">(iPixels)</span><span class="type-signature"> &rarr; {int}</span></span></dt><dd class=" odd"><p>Calculate the row number that will be found at the given pixel position (y-scroll)</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a href="#fnRowToPixels">fnRowToPixels</a></span><span class="type-sig"><span class="signature">(iRow)</span><span class="type-signature"> &rarr; {int}</span></span></dt><dd class=" even"><p>Calculate the pixel position from the top of the scrolling container for a given row</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a href="#fnScrollToRow">fnScrollToRow</a></span><span class="type-sig"><span class="signature">(iRow, <span class="optional">bAnimate</span>)</span><span class="type-signature"> &rarr; {void}</span></span></dt><dd class=" odd"><p>Calculate the row number that will be found at the given pixel position (y-scroll)</p></dd>
</dl>
</div>
</div>
<div class="doc_details">
<a name="details"></a>
<h2>Details</h2>
<div class="doc_group"><a name="details_properties"></a><h3 class="subsection-title">Properties - instance</h3>
<dl>
<dt class=" even"><a name="CLASS"></a><a name="CLASS_details"></a><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a href="#CLASS">CLASS</a></span><span class="type-sig"><span class="type-signature"> :String</span></span></dt><dd class=" even"><p>Name of this class</p><div class="collapse_details"><dl class="details">
</dl>
</div></dd>
</dl></div><div class="doc_group"><a name="details_properties"></a><h3 class="subsection-title">Properties - static</h3>
<dl>
<dt class=" even"><a name="VERSION"></a><a name="VERSION_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#VERSION">VERSION</a></span><span class="type-sig"><span class="type-signature"> :String</span></span></dt><dd class=" even"><p>Scroller version</p><div class="collapse_details"><dl class="details">
</dl>
</div></dd>
</dl></div><div class="doc_group"><a name="details_methods"></a><h3 class="subsection-title">Methods - instance</h3>
<dl>
<dt id="Scroller#fnMeasure" class=" even"><a name="fnMeasure"></a><a name="fnMeasure_details"></a><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a>fnMeasure</a></span><span class="type-sig"><span class="signature">(<span class="optional">bRedraw</span>)</span><span class="type-signature"> &rarr; {void}</span></span></span></dt><dd class=" even"><p>Calculate and store information about how many rows are to be displayed in the scrolling
viewport, based on current dimensions in the browser's rendering. This can be particularly
useful if the table is initially drawn in a hidden element - for example in a tab.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">bRedraw</td><td class="type type-param">bool</td><td class="attributes">Optional</td><td class="default">true</td><td class="description last"><p>Redraw the table automatically after the recalculation, with
the new dimentions forming the basis for the draw.</p></td></tr>
</tbody>
</table><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready(function() {
// Make the example container hidden to throw off the browser's sizing
document.getElementById('container').style.display = "none";
var oTable = $('#example').dataTable( {
"sScrollY": "200px",
"sAjaxSource": "media/dataset/large.txt",
"sDom": "frtiS",
"bDeferRender": true,
"fnInitComplete": function (o) {
// Immediately scroll to row 1000
o.oScroller.fnScrollToRow( 1000 );
}
} );
setTimeout( function () {
// Make the example container visible and recalculate the scroller sizes
document.getElementById('container').style.display = "block";
oTable.fnSettings().oScroller.fnMeasure();
}, 3000 );</pre>
</div>
</div>
<dt id="Scroller#fnPixelsToRow" class=" odd"><a name="fnPixelsToRow"></a><a name="fnPixelsToRow_details"></a><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a>fnPixelsToRow</a></span><span class="type-sig"><span class="signature">(iPixels)</span><span class="type-signature"> &rarr; {int}</span></span></span></dt><dd class=" odd"><p>Calculate the row number that will be found at the given pixel position (y-scroll)</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">iPixels</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Offset from top to caluclate the row number of</p></td></tr>
</tbody>
</table><h5>Returns:</h5><p class="returns"><p>Row index</p></p><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready(function() {
$('#example').dataTable( {
"sScrollY": "200px",
"sAjaxSource": "media/dataset/large.txt",
"sDom": "frtiS",
"bDeferRender": true,
"fnInitComplete": function (o) {
// Find what row number is at 500px
alert( o.oScroller.fnPixelsToRow( 500 ) );
}
} );
} );</pre>
</div>
</div>
<dt id="Scroller#fnRowToPixels" class=" even"><a name="fnRowToPixels"></a><a name="fnRowToPixels_details"></a><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a>fnRowToPixels</a></span><span class="type-sig"><span class="signature">(iRow)</span><span class="type-signature"> &rarr; {int}</span></span></span></dt><dd class=" even"><p>Calculate the pixel position from the top of the scrolling container for a given row</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">iRow</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Row number to calculate the position of</p></td></tr>
</tbody>
</table><h5>Returns:</h5><p class="returns"><p>Pixels</p></p><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready(function() {
$('#example').dataTable( {
"sScrollY": "200px",
"sAjaxSource": "media/dataset/large.txt",
"sDom": "frtiS",
"bDeferRender": true,
"fnInitComplete": function (o) {
// Find where row 25 is
alert( o.oScroller.fnRowToPixels( 25 ) );
}
} );
} );</pre>
</div>
</div>
<dt id="Scroller#fnScrollToRow" class=" odd"><a name="fnScrollToRow"></a><a name="fnScrollToRow_details"></a><span class="type-attr"><span class="type-signature"></span></span><span class="type-name"><a>fnScrollToRow</a></span><span class="type-sig"><span class="signature">(iRow, <span class="optional">bAnimate</span>)</span><span class="type-signature"> &rarr; {void}</span></span></span></dt><dd class=" odd"><p>Calculate the row number that will be found at the given pixel position (y-scroll)</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th width="20"></th>
<th width="12%" class="bottom_border name">Name</th>
<th width="10%" class="bottom_border">Type</th>
<th width="10%" class="bottom_border">Attributes</th>
<th width="10%" class="bottom_border">Default</th>
<th class="last bottom_border">Description</th>
</tr>
</thead>
<tbody>
<tr class="even"><td class="number right_border"><div>1</div></td><td class="name">iRow</td><td class="type type-param">int</td><td class="attributes"></td><td class="default"></td><td class="description last"><p>Row index to scroll to</p></td></tr><tr class="odd"><td class="number right_border"><div>2</div></td><td class="name">bAnimate</td><td class="type type-param">bool</td><td class="attributes">Optional</td><td class="default">true</td><td class="description last"><p>Animate the transision or not</p></td></tr>
</tbody>
</table><h5>Example:</h5>
<div class="example-code">
<pre class="brush: js"> $(document).ready(function() {
$('#example').dataTable( {
"sScrollY": "200px",
"sAjaxSource": "media/dataset/large.txt",
"sDom": "frtiS",
"bDeferRender": true,
"fnInitComplete": function (o) {
// Immediately scroll to row 1000
o.oScroller.fnScrollToRow( 1000 );
}
} );
// Sometime later on use the following to scroll to row 500...
var oSettings = $('#example').dataTable().fnSettings();
oSettings.oScroller.fnScrollToRow( 500 );
} );</pre>
</div>
</div>
</dd>
</div>
</div>
</div>
<div class="fw_footer">
Scroller: Copyright 2011-2012 Allan Jardine, all rights reserved<br>
Documentation generated by <a href="https://github.com/micmath/JSDoc">JSDoc 3</a> on
23th Sep 2012 - 14:28
with the <a href="http://datatables.net/">DataTables</a> template.
</div>
</body>
</html>

View File

@@ -0,0 +1,217 @@
<!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>Namespace: oDefaults - documentation</title>
<style type="text/css" media="screen">
@import "media/css/doc.css";
@import "media/css/shCore.css";
@import "media/css/shThemeDataTables.css";
</style>
<script type="text/javascript" src="media/js/shCore.js"></script>
<script type="text/javascript" src="media/js/shBrushJScript.js"></script>
<script type="text/javascript" src="media/js/jquery.js"></script>
<script type="text/javascript" src="media/js/doc.js"></script>
</head>
<body>
<div class="fw_container">
<a name="top"></a>
<div class="fw_header">
<h1 class="page-title">Namespace: oDefaults</h1>
<h2 class="ancestors">Ancestry: <span class="ancestors"><a href="Scroller.html">Scroller</a>.</span> » oDefaults</h2>
<div class="page-info">
Scroller v1.1.0 documentation
</div>
</div>
<div class="fw_nav">
<h2>Navigation</h2>
<ul>
<li><a href="#top">Overview</a></li>
<li><a href="#summary">Summary</a><div><table cellpadding="5" border="0" cellspacing="0" width="100%"><tbody><tr><td>Classes (0)</td><td>Namespaces (0)</td></tr><tr><td>Properties (0)</td><td><a href="#summary_properties_static">Static properties (6)</a></td></tr><tr><td>Methods (0)</td><td>Static methods (0)</td></tr><tr><td>Events (0)</td><td></td></tr></tbody></table></div></li><li><a href="#details">Details</a><div><table cellpadding="5" border="0" cellspacing="0" width="100%"><tbody><tr><td>Properties (0)</td><td><a href="#summary_properties_static">Static properties (6)</a></td></tr><tr><td>Methods (0)</td><td>Static methods (0)</td></tr><tr><td>Events (0)</td><td></td></tr></tbody></table></div></li></ul>
<div style="margin-top: 10px;">
<input type="hidden" name="show_private" value="0">
<span id="private_label">Hiding</span> private elements
(<a id="private_toggle" href="">toggle</a>)
</span>
</div>
<div>
<input type="hidden" name="show_extended" value="1">
<span id="extended_label">Showing</span> extended elements
(<a id="extended_toggle" href="">toggle</a>)
</span>
</div>
</div>
<div class="fw_content">
<a name="overview"></a>
<div class="doc_overview">
<div class="nav_blocker"></div>
<p>Scroller default settings for initialisation</p><dl class="details">
</dl>
</div>
<div class="doc_summary">
<a name="summary"></a>
<h2>Summary</h2>
<div class="doc_group"><a name="summary_properties_static"></a><h3 class="subsection-title">Properties - static</h3>
<dl>
<dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#boundaryScale">boundaryScale</a></span><span class="type-sig"><span class="type-signature"> :float</span></span></dt><dd class=" even"><p>Scroller uses the boundary scaling factor to decide when to redraw the table - which it
typically does before you reach the end of the currently loaded data set (in order to
allow the data to look continuous to a user scrolling through the data). If given as 0
then the table will be redrawn whenever the viewport is scrolled, while 1 would not
redraw the table until the currently loaded data has all been shown. You will want
something in the middle - the default factor of 0.5 is usually suitable.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#displayBuffer">displayBuffer</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>The display buffer is what Scroller uses to calculate how many rows it should pre-fetch
for scrolling. Scroller automatically adjusts DataTables' display length to pre-fetch
rows that will be shown in "near scrolling" (i.e. just beyond the current display area).
The value is based upon the number of rows that can be displayed in the viewport (i.e.
a value of 1), and will apply the display range to records before before and after the
current viewport - i.e. a factor of 3 will allow Scroller to pre-fetch 1 viewport's worth
of rows before the current viewport, the current viewport's rows and 1 viewport's worth
of rows after the current viewport. Adjusting this value can be useful for ensuring
smooth scrolling based on your data set.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#loadingIndicator">loadingIndicator</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Show (or not) the loading element in the background of the table. Note that you should
include the dataTables.scroller.css file for this to be displayed correctly.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#rowHeight">rowHeight</a></span><span class="type-sig"><span class="type-signature"> :int|string</span></span></dt><dd class=" odd"><p>Scroller will attempt to automatically calculate the height of rows for it's internal
calculations. However the height that is used can be overridden using this parameter.</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#serverWait">serverWait</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" even"><p>When using server-side processing, Scroller will wait a small amount of time to allow
the scrolling to finish before requesting more data from the server. This prevents
you from DoSing your own server! The wait time can be configured by this parameter.</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#trace">trace</a></span><span class="type-sig"><span class="type-signature"> :bool</span></span></dt><dd class=" odd"><p>Indicate if Scroller show show trace information on the console or not. This can be
useful when debugging Scroller or if just curious as to what it is doing, but should
be turned off for production.</p></dd>
</dl></div>
</div>
<div class="doc_details">
<a name="details"></a>
<h2>Details</h2>
<div class="doc_group"><a name="details_properties"></a><h3 class="subsection-title">Properties - static</h3>
<dl>
<dt class=" even"><a name="boundaryScale"></a><a name="boundaryScale_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#boundaryScale">boundaryScale</a></span><span class="type-sig"><span class="type-signature"> :float</span></span></dt><dd class=" even"><p>Scroller uses the boundary scaling factor to decide when to redraw the table - which it
typically does before you reach the end of the currently loaded data set (in order to
allow the data to look continuous to a user scrolling through the data). If given as 0
then the table will be redrawn whenever the viewport is scrolled, while 1 would not
redraw the table until the currently loaded data has all been shown. You will want
something in the middle - the default factor of 0.5 is usually suitable.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> var oTable = $('#example').dataTable( {
"sScrollY": "200px",
"sDom": "frtiS",
"bDeferRender": true,
"oScroller": {
"boundaryScale": 0.75
}
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="displayBuffer"></a><a name="displayBuffer_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#displayBuffer">displayBuffer</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>The display buffer is what Scroller uses to calculate how many rows it should pre-fetch
for scrolling. Scroller automatically adjusts DataTables' display length to pre-fetch
rows that will be shown in "near scrolling" (i.e. just beyond the current display area).
The value is based upon the number of rows that can be displayed in the viewport (i.e.
a value of 1), and will apply the display range to records before before and after the
current viewport - i.e. a factor of 3 will allow Scroller to pre-fetch 1 viewport's worth
of rows before the current viewport, the current viewport's rows and 1 viewport's worth
of rows after the current viewport. Adjusting this value can be useful for ensuring
smooth scrolling based on your data set.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> var oTable = $('#example').dataTable( {
"sScrollY": "200px",
"sDom": "frtiS",
"bDeferRender": true,
"oScroller": {
"displayBuffer": 10
}
} );</pre>
</div>
</div></dd><dt class=" even"><a name="loadingIndicator"></a><a name="loadingIndicator_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#loadingIndicator">loadingIndicator</a></span><span class="type-sig"><span class="type-signature"> :boolean</span></span></dt><dd class=" even"><p>Show (or not) the loading element in the background of the table. Note that you should
include the dataTables.scroller.css file for this to be displayed correctly.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> var oTable = $('#example').dataTable( {
"sScrollY": "200px",
"sDom": "frtiS",
"bDeferRender": true,
"oScroller": {
"loadingIndicator": true
}
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="rowHeight"></a><a name="rowHeight_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#rowHeight">rowHeight</a></span><span class="type-sig"><span class="type-signature"> :int|string</span></span></dt><dd class=" odd"><p>Scroller will attempt to automatically calculate the height of rows for it's internal
calculations. However the height that is used can be overridden using this parameter.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> var oTable = $('#example').dataTable( {
"sScrollY": "200px",
"sDom": "frtiS",
"bDeferRender": true,
"oScroller": {
"rowHeight": 30
}
} );</pre>
</div>
</div></dd><dt class=" even"><a name="serverWait"></a><a name="serverWait_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#serverWait">serverWait</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" even"><p>When using server-side processing, Scroller will wait a small amount of time to allow
the scrolling to finish before requesting more data from the server. This prevents
you from DoSing your own server! The wait time can be configured by this parameter.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> var oTable = $('#example').dataTable( {
"sScrollY": "200px",
"sDom": "frtiS",
"bDeferRender": true,
"oScroller": {
"serverWait": 100
}
} );</pre>
</div>
</div></dd><dt class=" odd"><a name="trace"></a><a name="trace_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#trace">trace</a></span><span class="type-sig"><span class="type-signature"> :bool</span></span></dt><dd class=" odd"><p>Indicate if Scroller show show trace information on the console or not. This can be
useful when debugging Scroller or if just curious as to what it is doing, but should
be turned off for production.</p><div class="collapse_details"><dl class="details">
</dl>
<h5>Example</h5>
<div class="example-code">
<pre class="brush: js"> var oTable = $('#example').dataTable( {
"sScrollY": "200px",
"sDom": "frtiS",
"bDeferRender": true,
"oScroller": {
"trace": true
}
} );</pre>
</div>
</div></dd>
</dl></div>
</div>
</div>
<div class="fw_footer">
Scroller: Copyright 2011-2012 Allan Jardine, all rights reserved<br>
Documentation generated by <a href="https://github.com/micmath/JSDoc">JSDoc 3</a> on
23th Sep 2012 - 14:28
with the <a href="http://datatables.net/">DataTables</a> template.
</div>
</body>
</html>

View File

@@ -0,0 +1,132 @@
<!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>Namespace: s - documentation</title>
<style type="text/css" media="screen">
@import "media/css/doc.css";
@import "media/css/shCore.css";
@import "media/css/shThemeDataTables.css";
</style>
<script type="text/javascript" src="media/js/shCore.js"></script>
<script type="text/javascript" src="media/js/shBrushJScript.js"></script>
<script type="text/javascript" src="media/js/jquery.js"></script>
<script type="text/javascript" src="media/js/doc.js"></script>
</head>
<body>
<div class="fw_container">
<a name="top"></a>
<div class="fw_header">
<h1 class="page-title">Namespace: s</h1>
<h2 class="ancestors">Ancestry: <span class="ancestors"><a href="Scroller.html">Scroller</a>#</span> » s</h2>
<div class="page-info">
Scroller v1.1.0 documentation
</div>
</div>
<div class="fw_nav">
<h2>Navigation</h2>
<ul>
<li><a href="#top">Overview</a></li>
<li><a href="#summary">Summary</a><div><table cellpadding="5" border="0" cellspacing="0" width="100%"><tbody><tr><td>Classes (0)</td><td>Namespaces (0)</td></tr><tr><td>Properties (0)</td><td><a href="#summary_properties_static">Static properties (9)</a></td></tr><tr><td>Methods (0)</td><td>Static methods (0)</td></tr><tr><td>Events (0)</td><td></td></tr></tbody></table></div></li><li><a href="#details">Details</a><div><table cellpadding="5" border="0" cellspacing="0" width="100%"><tbody><tr><td>Properties (0)</td><td><a href="#summary_properties_static">Static properties (9)</a></td></tr><tr><td>Methods (0)</td><td>Static methods (0)</td></tr><tr><td>Events (0)</td><td></td></tr></tbody></table></div></li></ul>
<div style="margin-top: 10px;">
<input type="hidden" name="show_private" value="0">
<span id="private_label">Hiding</span> private elements
(<a id="private_toggle" href="">toggle</a>)
</span>
</div>
<div>
<input type="hidden" name="show_extended" value="1">
<span id="extended_label">Showing</span> extended elements
(<a id="extended_toggle" href="">toggle</a>)
</span>
</div>
</div>
<div class="fw_content">
<a name="overview"></a>
<div class="doc_overview">
<div class="nav_blocker"></div>
<p>Settings object which contains customisable information for the Scroller instance</p><dl class="details">
</dl>
<h3 class="subsection-title">Extends</h3>
<ul>
<li>Scroller.DEFAULTS</li>
</ul>
</div>
<div class="doc_summary">
<a name="summary"></a>
<h2>Summary</h2>
<div class="doc_group"><a name="summary_properties_static"></a><h3 class="subsection-title">Properties - static</h3>
<dl>
<dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#autoHeight">autoHeight</a></span><span class="type-sig"><span class="type-signature"> :bool</span></span></dt><dd class=" even"><p>Auto row height or not indicator</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#drawTO">drawTO</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>setTimeout reference for the redraw, used when server-side processing is enabled in the
DataTables in order to prevent DoSing the server</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#dt">dt</a></span><span class="type-sig"><span class="type-signature"> :object</span></span></dt><dd class=" even"><p>DataTables settings object</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#rowHeight">rowHeight</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>Height of rows in the table</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#stateTO">stateTO</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" even"><p>setTimeout reference for state saving, used when state saving is enabled in the DataTable
and when the user scrolls the viewport in order to stop the cookie set taking too much
CPU!</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#tableBottom">tableBottom</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>Pixel location of the bottom of the drawn table in the viewport</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#tableTop">tableTop</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" even"><p>Pixel location of the top of the drawn table in the viewport</p></dd><dt class=" odd"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#viewportHeight">viewportHeight</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>Pixel height of the viewport</p></dd><dt class=" even"><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#viewportRows">viewportRows</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" even"><p>Number of rows calculated as visible in the visible viewport</p></dd>
</dl></div>
</div>
<div class="doc_details">
<a name="details"></a>
<h2>Details</h2>
<div class="doc_group"><a name="details_properties"></a><h3 class="subsection-title">Properties - static</h3>
<dl>
<dt class=" even"><a name="autoHeight"></a><a name="autoHeight_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#autoHeight">autoHeight</a></span><span class="type-sig"><span class="type-signature"> :bool</span></span></dt><dd class=" even"><p>Auto row height or not indicator</p><div class="collapse_details"><dl class="details">
</dl>
</div></dd><dt class=" odd"><a name="drawTO"></a><a name="drawTO_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#drawTO">drawTO</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>setTimeout reference for the redraw, used when server-side processing is enabled in the
DataTables in order to prevent DoSing the server</p><div class="collapse_details"><dl class="details">
</dl>
</div></dd><dt class=" even"><a name="dt"></a><a name="dt_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#dt">dt</a></span><span class="type-sig"><span class="type-signature"> :object</span></span></dt><dd class=" even"><p>DataTables settings object</p><div class="collapse_details"><dl class="details">
</dl>
</div></dd><dt class=" odd"><a name="rowHeight"></a><a name="rowHeight_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#rowHeight">rowHeight</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>Height of rows in the table</p><div class="collapse_details"><dl class="details">
</dl>
</div></dd><dt class=" even"><a name="stateTO"></a><a name="stateTO_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#stateTO">stateTO</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" even"><p>setTimeout reference for state saving, used when state saving is enabled in the DataTable
and when the user scrolls the viewport in order to stop the cookie set taking too much
CPU!</p><div class="collapse_details"><dl class="details">
</dl>
</div></dd><dt class=" odd"><a name="tableBottom"></a><a name="tableBottom_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#tableBottom">tableBottom</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>Pixel location of the bottom of the drawn table in the viewport</p><div class="collapse_details"><dl class="details">
</dl>
</div></dd><dt class=" even"><a name="tableTop"></a><a name="tableTop_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#tableTop">tableTop</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" even"><p>Pixel location of the top of the drawn table in the viewport</p><div class="collapse_details"><dl class="details">
</dl>
</div></dd><dt class=" odd"><a name="viewportHeight"></a><a name="viewportHeight_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#viewportHeight">viewportHeight</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" odd"><p>Pixel height of the viewport</p><div class="collapse_details"><dl class="details">
</dl>
</div></dd><dt class=" even"><a name="viewportRows"></a><a name="viewportRows_details"></a><span class="type-attr"><span class="type-signature">&lt;static> </span></span><span class="type-name"><a href="#viewportRows">viewportRows</a></span><span class="type-sig"><span class="type-signature"> :int</span></span></dt><dd class=" even"><p>Number of rows calculated as visible in the visible viewport</p><div class="collapse_details"><dl class="details">
</dl>
</div></dd>
</dl></div>
</div>
</div>
<div class="fw_footer">
Scroller: Copyright 2011-2012 Allan Jardine, all rights reserved<br>
Documentation generated by <a href="https://github.com/micmath/JSDoc">JSDoc 3</a> on
23th Sep 2012 - 14:28
with the <a href="http://datatables.net/">DataTables</a> template.
</div>
</body>
</html>

View File

@@ -0,0 +1,75 @@
<!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>Namespace: dom - documentation</title>
<style type="text/css" media="screen">
@import "media/css/doc.css";
@import "media/css/shCore.css";
@import "media/css/shThemeDataTables.css";
</style>
<script type="text/javascript" src="media/js/shCore.js"></script>
<script type="text/javascript" src="media/js/shBrushJScript.js"></script>
<script type="text/javascript" src="media/js/jquery.js"></script>
<script type="text/javascript" src="media/js/doc.js"></script>
</head>
<body>
<div class="fw_container">
<a name="top"></a>
<div class="fw_header">
<h1 class="page-title">Namespace: dom</h1>
<h2 class="ancestors">Ancestry: <span class="ancestors"><a href="Scroller.html">Scroller</a>#</span> » dom</h2>
<div class="page-info">
Scroller v1.1.0 documentation
</div>
</div>
<div class="fw_nav">
<h2>Navigation</h2>
<ul>
<li><a href="#top">Overview</a></li>
<li><a href="#summary">Summary</a><div><table cellpadding="5" border="0" cellspacing="0" width="100%"><tbody><tr><td>Classes (0)</td><td>Namespaces (0)</td></tr><tr><td>Properties (0)</td><td>Static properties (0)</td></tr><tr><td>Methods (0)</td><td>Static methods (0)</td></tr><tr><td>Events (0)</td><td></td></tr></tbody></table></div></li><li><a href="#details">Details</a><div><table cellpadding="5" border="0" cellspacing="0" width="100%"><tbody><tr><td>Properties (0)</td><td>Static properties (0)</td></tr><tr><td>Methods (0)</td><td>Static methods (0)</td></tr><tr><td>Events (0)</td><td></td></tr></tbody></table></div></li></ul>
<div style="margin-top: 10px;">
<input type="hidden" name="show_private" value="0">
<span id="private_label">Hiding</span> private elements
(<a id="private_toggle" href="">toggle</a>)
</span>
</div>
<div>
<input type="hidden" name="show_extended" value="1">
<span id="extended_label">Showing</span> extended elements
(<a id="extended_toggle" href="">toggle</a>)
</span>
</div>
</div>
<div class="fw_content">
<a name="overview"></a>
<div class="doc_overview">
<div class="nav_blocker"></div>
<p>DOM elements used by the class instance</p><dl class="details">
</dl>
</div>
</div>
<div class="fw_footer">
Scroller: Copyright 2011-2012 Allan Jardine, all rights reserved<br>
Documentation generated by <a href="https://github.com/micmath/JSDoc">JSDoc 3</a> on
23th Sep 2012 - 14:28
with the <a href="http://datatables.net/">DataTables</a> template.
</div>
</body>
</html>

View File

@@ -0,0 +1,64 @@
<!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>Table of Contents - documentation</title>
<style type="text/css" media="screen">
@import "media/css/doc.css";
@import "media/css/shCore.css";
@import "media/css/shThemeDataTables.css";
</style>
<script type="text/javascript" src="media/js/shCore.js"></script>
<script type="text/javascript" src="media/js/shBrushJScript.js"></script>
<script type="text/javascript" src="media/js/jquery.js"></script>
<script type="text/javascript" src="media/js/doc.js"></script>
</head>
<body>
<div class="fw_container">
<a name="top"></a>
<div class="fw_header">
</div>
<div class="fw_content">
<h3 class="subsection-title">Table of Contents</h3>
<dl>
<dt><a href="Scroller.html">Scroller</a></dt><dd><p>Scroller is a virtual rendering plug-in for DataTables which allows large
datasets to be drawn on screen every quickly. What the virtual rendering means
is that only the visible portion of the table (and a bit to either side to make
the scrolling smooth) is drawn, while the scrolling container gives the
visual impression that the whole table is visible. This is done by making use
of the pagination abilities of DataTables and moving the table around in the
scrolling container DataTables adds to the page. The scrolling container is
forced to the height it would be for the full table display using an extra
element. </p>
<p>Note that rows in the table MUST all be the same height. Information in a cell
which expands on to multiple lines will cause some odd behaviour in the scrolling.</p>
<p>Scroller is initialised by simply including the letter 'S' in the sDom for the
table you want to have this feature enabled on. Note that the 'S' must come
AFTER the 't' parameter in sDom.</p>
<p>Key features include:
<ul class="limit_length">
<li>Speed! The aim of Scroller for DataTables is to make rendering large data sets fast</li>
<li>Full compatibility with deferred rendering in DataTables 1.9 for maximum speed</li>
<li>Correct visual scrolling implementation, similar to "infinite scrolling" in DataTable core</li>
<li>Integration with state saving in DataTables (scrolling position is saved)</li>
<li>Easy to use</li>
</ul></p></dd>
</dl>
</div>
</div>
<div class="fw_footer">
Scroller: Copyright 2011-2012 Allan Jardine, all rights reserved<br>
Documentation generated by <a href="https://github.com/micmath/JSDoc">JSDoc 3</a> on
23th Sep 2012 - 14:28
with the <a href="http://datatables.net/">DataTables</a> template.
</div>
</body>
</html>

View File

@@ -0,0 +1,393 @@
/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 0.12.0
*/
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}
table{border-collapse:collapse;border-spacing:0;}
fieldset,img{border:0;}
address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}
ol,ul {list-style:none;}
caption,th {text-align:left;}
h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}
q:before,q:after{content:'';}
abbr,acronym {border:0;}
html, body {
margin: 0;
padding: 0;
width: 100%;
font: 14px/1.45em "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
color: #111;
}
div.fw_container {
width: 980px;
padding-top: 2em;
margin: 0 auto;
}
div.fw_header {
position: relative;
}
div.fw_content {
padding-top: 2em;
}
div.fw_footer {
padding-top: 4em;
font-size: 75%;
text-align: center;
}
.type-attr .type-signature {
background-color: #ccc;
color: white;
border-radius: 3px;
display: inline-block;
padding: 0 3px;
font-size: 0.9em;
}
.type-attr {
float: right;
color: #999;
}
.type-name {
font-weight: bold;
}
.type-sig {
color: #999;
}
.type-param {
color: #D32929;
}
.type-return {
color: #FF8080;
}
.type-brace {
color: #111;
}
.example-code {
margin-left: 30px;
}
.example-code td.code {
border-top: 1px solid #4E6CA3 !important;
}
.type-augmented {
position: absolute;
left: 8px;
top: 0;
}
dt, dd {
padding: 0.4em 10px;
}
dt {
padding-bottom: 0 !important;
}
dd {
position: relative;
padding-top: 0 !important;
padding-left: 3em;
}
dt.even, dd.even {
background-color: white;
}
dt.odd, dd.odd {
background-color: #F2F2F2;
}
div.doc_overview dd, div.doc_overview dt {
padding-left: 0 !important;
}
.right_border div {
width: 20px;
padding: 2px 0.5em 2px 1em;
text-align: right;
}
.right_border {
border-right: 3px solid #4E6CA3;
}
.bottom_border {
border-bottom: 1px solid #4E6CA3;
}
a {
text-decoration: none;
color: #4E6CA3;
}
a:hover {
text-decoration: underline;
cursor: pointer;
*cursor: hand;
}
div.fw_content ul {
list-style-image: url('../images/arrow.png');
padding: 0 0 0 2em;
}
/*
h2 {
font-size: 1.4em;
margin-top: 2em;
border-bottom: 3px solid #829ac6;
padding-left: 5px;
}
h3 {
font-size: 1.2em;
margin-top: 1em;
border-bottom: 1px solid #A4B5D5;
padding-left: 5px;
}
*/
h1 {
font-size: 2em;
}
h2 {
font-size: 1.6em;
padding-top: 5px;
}
h2.ancestors {
font-size: 14px;
margin: 0;
}
h3 {
font-size: 1.3em;
padding-top: 5px;
margin-bottom: 5px;
}
h5 {
padding-top: 6px;
font-weight: bold;
font-size: 0.9em;
border-bottom: 1px solid #cad4e6;
margin-bottom: 1em;
}
div.doc_summary, div.doc_details {
margin-top: 2em;
clear: both;
}
div.doc_group {
margin-top: 1em;
border-top: 1px solid #A4B5D5;
border-left: 1px solid #A4B5D5;
padding-left: 10px;
}
div.extended {
margin-left: 30px;
}
table.params {
margin-left: 30px;
width: 97%;
}
table.params th,
table.params td {
padding: 3px;
}
tr.odd {
background-color: white;
}
tr.even {
background-color: #F8F8F8;
}
th.name,
td.name {
padding-left: 13px;
}
td.number {
background-color: white;
color: #5C5C5C;
}
dd.odd td.number {
background-color: #F2F2F2;
}
p {
margin: 1em 0;
}
p:first-child {
margin-top: 0;
}
p:last-child {
margin-bottom: 0;
}
p.returns {
margin-left: 5%;
}
div.page-info {
position: absolute;
top: 0;
right: 0;
}
.private {
display: none;
}
code {
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
padding: 2px 4px !important;
white-space: pre;
font-size: 0.9em;
color: #D14;
background-color: #F7F7F9;
border: 1px solid #E1E1E8;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
pre {
background-color: #f8f8f8;
border: 1px solid #ccc;
border-radius: 3px;
padding: 6px 10px;
}
pre>code {
background-color: transparent;
border: none;
color: #111;
}
strong {
font-weight: bold;
}
em {
font-style: italic;
}
ol {
list-style-type: decimal;
list-style-position: outside;
padding-left: 30px;
}
div.fw_nav {
position: fixed;
top: 25px;
right: 30px;
width: 250px;
border: 1px solid #A4B5D5;
background-color: white;
padding: 10px;
z-index: 1001;
font-size: 12px;
overflow: hidden;
}
div.fw_nav h2 {
margin: -10px 0 10px -10px;
width: 250px;
padding: 5px 10px;
background-color: #A4B5D5;
font-size: 12px;
cursor: pointer;
*cursor: hand;
}
div.fw_nav ul>li>div {
padding: 0 0 0 1em;
}
div.nav_blocker {
float: right;
}
div.fw_nav td {
color: #999;
}
div.fw_nav li {
margin-bottom: 5px;
}
div.fw_nav li>a {
font-weight: bold;
}
.css_clear {
clear: both;
height: 0;
line-height: 0;
visibility: hidden;
}
.css_right {
text-align: right;
}
.css_center {
text-align: center;
}
.css_spacing {
margin-top: 1.5em;
}
.css_small {
font-size: 75%;
line-height: 1.45em;
}
.css_vsmall {
font-size: 65%;
line-height: 1.45em;
}

View File

@@ -0,0 +1,226 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter a,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody,
.syntaxhighlighter table thead,
.syntaxhighlighter table caption,
.syntaxhighlighter textarea {
-moz-border-radius: 0 0 0 0 !important;
-webkit-border-radius: 0 0 0 0 !important;
background: none !important;
border: 0 !important;
bottom: auto !important;
float: none !important;
height: auto !important;
left: auto !important;
line-height: 1.1em !important;
margin: 0 !important;
outline: 0 !important;
overflow: visible !important;
padding: 0 !important;
position: static !important;
right: auto !important;
text-align: left !important;
top: auto !important;
vertical-align: baseline !important;
width: auto !important;
box-sizing: content-box !important;
font-family: "Consolas","Monaco","Bitstream Vera Sans Mono","Courier New",Courier,monospace !important;
font-weight: normal !important;
font-style: normal !important;
font-size: 1em !important;
min-height: inherit !important;
min-height: auto !important;
}
.syntaxhighlighter {
width: 100% !important;
margin: 1em 0 1em 0 !important;
position: relative !important;
overflow: auto !important;
font-size: 1em !important;
}
.syntaxhighlighter.source {
overflow: hidden !important;
}
.syntaxhighlighter .bold {
font-weight: bold !important;
}
.syntaxhighlighter .italic {
font-style: italic !important;
}
.syntaxhighlighter .line {
white-space: pre !important;
}
.syntaxhighlighter table {
width: 100% !important;
}
.syntaxhighlighter table caption {
text-align: left !important;
padding: .5em 0 0.5em 1em !important;
}
.syntaxhighlighter table td.code {
width: 100% !important;
}
.syntaxhighlighter table td.code .container {
position: relative !important;
}
.syntaxhighlighter table td.code .container textarea {
box-sizing: border-box !important;
position: absolute !important;
left: 0 !important;
top: 0 !important;
width: 100% !important;
height: 100% !important;
border: none !important;
background: white !important;
padding-left: 1em !important;
overflow: hidden !important;
white-space: pre !important;
}
.syntaxhighlighter table td.gutter .line {
text-align: right !important;
padding: 2px 0.5em 2px 1em !important;
}
.syntaxhighlighter table td.code .line {
padding: 2px 1em !important;
}
.syntaxhighlighter.nogutter td.code .container textarea, .syntaxhighlighter.nogutter td.code .line {
padding-left: 0em !important;
}
.syntaxhighlighter.show {
display: block !important;
}
.syntaxhighlighter.collapsed table {
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar {
padding: 0.1em 0.8em 0em 0.8em !important;
font-size: 1em !important;
position: static !important;
width: auto !important;
height: auto !important;
}
.syntaxhighlighter.collapsed .toolbar span {
display: inline !important;
margin-right: 1em !important;
}
.syntaxhighlighter.collapsed .toolbar span a {
padding: 0 !important;
display: none !important;
}
.syntaxhighlighter.collapsed .toolbar span a.expandSource {
display: inline !important;
}
.syntaxhighlighter .toolbar {
position: absolute !important;
right: 1px !important;
top: 1px !important;
width: 11px !important;
height: 11px !important;
font-size: 10px !important;
z-index: 10 !important;
}
.syntaxhighlighter .toolbar span.title {
display: inline !important;
}
.syntaxhighlighter .toolbar a {
display: block !important;
text-align: center !important;
text-decoration: none !important;
padding-top: 1px !important;
}
.syntaxhighlighter .toolbar a.expandSource {
display: none !important;
}
.syntaxhighlighter.ie {
font-size: .9em !important;
padding: 1px 0 1px 0 !important;
}
.syntaxhighlighter.ie .toolbar {
line-height: 8px !important;
}
.syntaxhighlighter.ie .toolbar a {
padding-top: 0px !important;
}
.syntaxhighlighter.printing .line.alt1 .content,
.syntaxhighlighter.printing .line.alt2 .content,
.syntaxhighlighter.printing .line.highlighted .number,
.syntaxhighlighter.printing .line.highlighted.alt1 .content,
.syntaxhighlighter.printing .line.highlighted.alt2 .content {
background: none !important;
}
.syntaxhighlighter.printing .line .number {
color: #bbbbbb !important;
}
.syntaxhighlighter.printing .line .content {
color: black !important;
}
.syntaxhighlighter.printing .toolbar {
display: none !important;
}
.syntaxhighlighter.printing a {
text-decoration: none !important;
}
.syntaxhighlighter.printing .plain, .syntaxhighlighter.printing .plain a {
color: black !important;
}
.syntaxhighlighter.printing .comments, .syntaxhighlighter.printing .comments a {
color: #008200 !important;
}
.syntaxhighlighter.printing .string, .syntaxhighlighter.printing .string a {
color: blue !important;
}
.syntaxhighlighter.printing .keyword {
color: #006699 !important;
font-weight: bold !important;
}
.syntaxhighlighter.printing .preprocessor {
color: gray !important;
}
.syntaxhighlighter.printing .variable {
color: #aa7700 !important;
}
.syntaxhighlighter.printing .value {
color: #009900 !important;
}
.syntaxhighlighter.printing .functions {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .constants {
color: #0066cc !important;
}
.syntaxhighlighter.printing .script {
font-weight: bold !important;
}
.syntaxhighlighter.printing .color1, .syntaxhighlighter.printing .color1 a {
color: gray !important;
}
.syntaxhighlighter.printing .color2, .syntaxhighlighter.printing .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter.printing .color3, .syntaxhighlighter.printing .color3 a {
color: red !important;
}
.syntaxhighlighter.printing .break, .syntaxhighlighter.printing .break a {
color: black !important;
}

View File

@@ -0,0 +1,128 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
.syntaxhighlighter {
background-color: white !important;
font-size: 14px !important;
overflow: visible !important;
}
.syntaxhighlighter .line.alt1 {
background-color: white !important;
}
.syntaxhighlighter .line.alt2 {
background-color: #F8F8F8 !important;
}
.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 {
background-color: #e0e0e0 !important;
}
.syntaxhighlighter .line.highlighted.number {
color: black !important;
}
.syntaxhighlighter table caption {
color: black !important;
}
.syntaxhighlighter .gutter {
}
.syntaxhighlighter .gutter div {
color: #5C5C5C !important;
width: 20px !important;
}
.syntaxhighlighter .gutter .line.alt1, .syntaxhighlighter .gutter .line.alt2 {
background-color: white !important;
}
.odd .syntaxhighlighter .gutter .line.alt1, .odd .syntaxhighlighter .gutter .line.alt2 {
background-color: #F2F2F2 !important;
}
.syntaxhighlighter .gutter .line {
border-right: 3px solid #4E6CA3 !important;
}
.syntaxhighlighter .gutter .line.highlighted {
background-color: #4E6CA3 !important;
color: white !important;
}
.syntaxhighlighter.printing .line .content {
border: none !important;
}
.syntaxhighlighter.collapsed {
overflow: visible !important;
}
.syntaxhighlighter.collapsed .toolbar {
color: blue !important;
background: white !important;
border: 1px solid #4E6CA3 !important;
}
.syntaxhighlighter.collapsed .toolbar a {
color: blue !important;
}
.syntaxhighlighter.collapsed .toolbar a:hover {
color: red !important;
}
.syntaxhighlighter .toolbar {
color: white !important;
background: #4E6CA3 !important;
border: none !important;
}
.syntaxhighlighter .toolbar a {
color: white !important;
}
.syntaxhighlighter .toolbar a:hover {
color: black !important;
}
.syntaxhighlighter .plain, .syntaxhighlighter .plain a {
color: black !important;
}
.syntaxhighlighter .comments, .syntaxhighlighter .comments a {
color: #008200 !important;
}
.syntaxhighlighter .string, .syntaxhighlighter .string a {
color: blue !important;
}
.syntaxhighlighter .keyword {
color: #006699 !important;
}
.syntaxhighlighter .preprocessor {
color: gray !important;
}
.syntaxhighlighter .variable {
color: #aa7700 !important;
}
.syntaxhighlighter .value {
color: #009900 !important;
}
.syntaxhighlighter .functions {
color: #ff1493 !important;
}
.syntaxhighlighter .constants {
color: #0066cc !important;
}
.syntaxhighlighter .script {
font-weight: bold !important;
color: #006699 !important;
background-color: none !important;
}
.syntaxhighlighter .color1, .syntaxhighlighter .color1 a {
color: gray !important;
}
.syntaxhighlighter .color2, .syntaxhighlighter .color2 a {
color: #ff1493 !important;
}
.syntaxhighlighter .color3, .syntaxhighlighter .color3 a {
color: red !important;
}
.syntaxhighlighter .keyword {
font-weight: bold !important;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1011 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,121 @@
(function() {
var showingNav = true;
$(document).ready( function () {
var jqNav = $('div.fw_nav');
jqNav.css('right', ($(window).width() - $('div.fw_container').width()) /2);
var n = $('div.nav_blocker')[0];
n.style.height = $(jqNav).outerHeight()+"px";
n.style.width = ($(jqNav).outerWidth()+20)+"px";
SyntaxHighlighter.highlight();
$('#private_toggle').click( function () {
if ( $('input[name=show_private]').val() == 0 ) {
$('input[name=show_private]').val( 1 );
$('#private_label').html('Showing');
$('.private').css('display', 'block');
} else {
$('input[name=show_private]').val( 0 );
$('#private_label').html('Hiding');
$('.private').css('display', 'none');
}
fnWriteCookie();
return false;
} );
$('#extended_toggle').click( function () {
if ( $('input[name=show_extended]').val() == 0 ) {
$('input[name=show_extended]').val( 1 );
$('#extended_label').html('Showing');
$('.augmented').css('display', 'block');
} else {
$('input[name=show_extended]').val( 0 );
$('#extended_label').html('Hiding');
$('.augmented').css('display', 'none');
}
fnWriteCookie();
return false;
} );
var savedHeight = $(jqNav).height();
$('div.fw_nav h2').click( function () {
if ( showingNav ) {
$('div.fw_nav').animate( {
"height": 10,
"opacity": 0.3
} );
showingNav = false;
} else {
$('div.fw_nav').animate( {
"height": savedHeight,
"opacity": 1
} );
showingNav = true;
}
fnWriteCookie();
} );
var cookie = fnReadCookie( 'SpryMedia_JSDoc' );
if ( cookie != null ) {
var a = cookie.split('-');
if ( a[0] == 1 ) {
$('#private_toggle').click();
}
if ( a[1] == 0 ) {
$('#extended_toggle').click();
}
if ( a[2] == 'false' ) {
$('div.fw_nav').css('height', 10).css('opacity', 0.3);
showingNav = false;
}
}
} );
function fnWriteCookie()
{
var sVal =
$('input[name=show_private]').val()+'-'+
$('input[name=show_extended]').val()+'-'+
showingNav;
fnCreateCookie( 'SpryMedia_JSDoc', sVal );
}
function fnCreateCookie( sName, sValue )
{
var iDays = 365;
var date = new Date();
date.setTime( date.getTime()+(iDays*24*60*60*1000) );
var sExpires = "; expires="+date.toGMTString();
document.cookie = sName+"="+sValue+sExpires+"; path=/";
}
function fnReadCookie( sName )
{
var sNameEQ = sName + "=";
var sCookieContents = document.cookie.split(';');
for( var i=0 ; i<sCookieContents.length ; i++ ) {
var c = sCookieContents[i];
while (c.charAt(0)==' ') {
c = c.substring(1,c.length);
}
if (c.indexOf(sNameEQ) == 0) {
return c.substring(sNameEQ.length,c.length);
}
}
return null;
}
})();

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,52 @@
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*
* @copyright
* Copyright (C) 2004-2010 Alex Gorbatchev.
*
* @license
* Dual licensed under the MIT and GPL licenses.
*/
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
function Brush()
{
var keywords = 'break case catch continue ' +
'default delete do else false ' +
'for function if in instanceof ' +
'new null return super switch ' +
'this throw true try typeof var while with'
;
var r = SyntaxHighlighter.regexLib;
this.regexList = [
{ regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
{ regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
{ regex: r.singleLineCComments, css: 'comments' }, // one line comments
{ regex: r.multiLineCComments, css: 'comments' }, // multiline comments
{ regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
];
this.forHtmlScript(r.scriptScriptTags);
};
Brush.prototype = new SyntaxHighlighter.Highlighter();
Brush.aliases = ['js', 'jscript', 'javascript'];
SyntaxHighlighter.brushes.JScript = Brush;
// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
Copyright (c) 2003, 2004 Jim Weirich
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1013 B

View File

@@ -0,0 +1,904 @@
/**
* @summary Scroller
* @description Virtual rendering for DataTables
* @file Scroller.js
* @version 1.1.0
* @author Allan Jardine (www.sprymedia.co.uk)
* @license GPL v2 or BSD 3 point style
* @contact www.sprymedia.co.uk/contact
*
* @copyright Copyright 2011-2012 Allan Jardine, all rights reserved.
*
* This source file is free software, under either the GPL v2 license or a
* BSD style license, available at:
* http://datatables.net/license_gpl2
* http://datatables.net/license_bsd
*/
(/** @lends <global> */function($, window, document) {
/**
* Scroller is a virtual rendering plug-in for DataTables which allows large
* datasets to be drawn on screen every quickly. What the virtual rendering means
* is that only the visible portion of the table (and a bit to either side to make
* the scrolling smooth) is drawn, while the scrolling container gives the
* visual impression that the whole table is visible. This is done by making use
* of the pagination abilities of DataTables and moving the table around in the
* scrolling container DataTables adds to the page. The scrolling container is
* forced to the height it would be for the full table display using an extra
* element.
*
* Note that rows in the table MUST all be the same height. Information in a cell
* which expands on to multiple lines will cause some odd behaviour in the scrolling.
*
* Scroller is initialised by simply including the letter 'S' in the sDom for the
* table you want to have this feature enabled on. Note that the 'S' must come
* AFTER the 't' parameter in sDom.
*
* Key features include:
* <ul class="limit_length">
* <li>Speed! The aim of Scroller for DataTables is to make rendering large data sets fast</li>
* <li>Full compatibility with deferred rendering in DataTables 1.9 for maximum speed</li>
* <li>Correct visual scrolling implementation, similar to "infinite scrolling" in DataTable core</li>
* <li>Integration with state saving in DataTables (scrolling position is saved)</li>
* <li>Easy to use</li>
* </ul>
*
* @class
* @constructor
* @param {object} oDT DataTables settings object
* @param {object} [oOpts={}] Configuration object for FixedColumns. Options are defined by {@link Scroller.oDefaults}
*
* @requires jQuery 1.4+
* @requires DataTables 1.9.0+
*
* @example
* $(document).ready(function() {
* $('#example').dataTable( {
* "sScrollY": "200px",
* "sAjaxSource": "media/dataset/large.txt",
* "sDom": "frtiS",
* "bDeferRender": true
* } );
* } );
*/
var Scroller = function ( oDTSettings, oOpts ) {
/* Sanity check - you just know it will happen */
if ( ! this instanceof Scroller )
{
alert( "Scroller warning: Scroller must be initialised with the 'new' keyword." );
return;
}
if ( typeof oOpts == 'undefined' )
{
oOpts = {};
}
/**
* Settings object which contains customisable information for the Scroller instance
* @namespace
* @extends Scroller.DEFAULTS
*/
this.s = {
/**
* DataTables settings object
* @type object
* @default Passed in as first parameter to constructor
*/
"dt": oDTSettings,
/**
* Pixel location of the top of the drawn table in the viewport
* @type int
* @default 0
*/
"tableTop": 0,
/**
* Pixel location of the bottom of the drawn table in the viewport
* @type int
* @default 0
*/
"tableBottom": 0,
/**
* Pixel location of the boundary for when the next data set should be loaded and drawn
* when scrolling up the way.
* @type int
* @default 0
* @private
*/
"redrawTop": 0,
/**
* Pixel location of the boundary for when the next data set should be loaded and drawn
* when scrolling down the way. Note that this is actually caluated as the offset from
* the top.
* @type int
* @default 0
* @private
*/
"redrawBottom": 0,
/**
* Height of rows in the table
* @type int
* @default 0
*/
"rowHeight": null,
/**
* Auto row height or not indicator
* @type bool
* @default 0
*/
"autoHeight": true,
/**
* Pixel height of the viewport
* @type int
* @default 0
*/
"viewportHeight": 0,
/**
* Number of rows calculated as visible in the visible viewport
* @type int
* @default 0
*/
"viewportRows": 0,
/**
* setTimeout reference for state saving, used when state saving is enabled in the DataTable
* and when the user scrolls the viewport in order to stop the cookie set taking too much
* CPU!
* @type int
* @default 0
*/
"stateTO": null,
/**
* setTimeout reference for the redraw, used when server-side processing is enabled in the
* DataTables in order to prevent DoSing the server
* @type int
* @default null
*/
"drawTO": null
};
this.s = $.extend( this.s, Scroller.oDefaults, oOpts );
/**
* DOM elements used by the class instance
* @namespace
*
*/
this.dom = {
"force": document.createElement('div'),
"scroller": null,
"table": null
};
/* Attach the instance to the DataTables instance so it can be accessed */
this.s.dt.oScroller = this;
/* Let's do it */
this._fnConstruct();
};
Scroller.prototype = {
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Public methods
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* Calculate the pixel position from the top of the scrolling container for a given row
* @param {int} iRow Row number to calculate the position of
* @returns {int} Pixels
* @example
* $(document).ready(function() {
* $('#example').dataTable( {
* "sScrollY": "200px",
* "sAjaxSource": "media/dataset/large.txt",
* "sDom": "frtiS",
* "bDeferRender": true,
* "fnInitComplete": function (o) {
* // Find where row 25 is
* alert( o.oScroller.fnRowToPixels( 25 ) );
* }
* } );
* } );
*/
"fnRowToPixels": function ( iRow )
{
return iRow * this.s.rowHeight;
},
/**
* Calculate the row number that will be found at the given pixel position (y-scroll)
* @param {int} iPixels Offset from top to caluclate the row number of
* @returns {int} Row index
* @example
* $(document).ready(function() {
* $('#example').dataTable( {
* "sScrollY": "200px",
* "sAjaxSource": "media/dataset/large.txt",
* "sDom": "frtiS",
* "bDeferRender": true,
* "fnInitComplete": function (o) {
* // Find what row number is at 500px
* alert( o.oScroller.fnPixelsToRow( 500 ) );
* }
* } );
* } );
*/
"fnPixelsToRow": function ( iPixels )
{
return parseInt( iPixels / this.s.rowHeight, 10 );
},
/**
* Calculate the row number that will be found at the given pixel position (y-scroll)
* @param {int} iRow Row index to scroll to
* @param {bool} [bAnimate=true] Animate the transision or not
* @returns {void}
* @example
* $(document).ready(function() {
* $('#example').dataTable( {
* "sScrollY": "200px",
* "sAjaxSource": "media/dataset/large.txt",
* "sDom": "frtiS",
* "bDeferRender": true,
* "fnInitComplete": function (o) {
* // Immediately scroll to row 1000
* o.oScroller.fnScrollToRow( 1000 );
* }
* } );
*
* // Sometime later on use the following to scroll to row 500...
* var oSettings = $('#example').dataTable().fnSettings();
* oSettings.oScroller.fnScrollToRow( 500 );
* } );
*/
"fnScrollToRow": function ( iRow, bAnimate )
{
var px = this.fnRowToPixels( iRow );
if ( typeof bAnimate == 'undefined' || bAnimate )
{
$(this.dom.scroller).animate( {
"scrollTop": px
} );
}
else
{
$(this.dom.scroller).scrollTop( px );
}
},
/**
* Calculate and store information about how many rows are to be displayed in the scrolling
* viewport, based on current dimensions in the browser's rendering. This can be particularly
* useful if the table is initially drawn in a hidden element - for example in a tab.
* @param {bool} [bRedraw=true] Redraw the table automatically after the recalculation, with
* the new dimentions forming the basis for the draw.
* @returns {void}
* @example
* $(document).ready(function() {
* // Make the example container hidden to throw off the browser's sizing
* document.getElementById('container').style.display = "none";
* var oTable = $('#example').dataTable( {
* "sScrollY": "200px",
* "sAjaxSource": "media/dataset/large.txt",
* "sDom": "frtiS",
* "bDeferRender": true,
* "fnInitComplete": function (o) {
* // Immediately scroll to row 1000
* o.oScroller.fnScrollToRow( 1000 );
* }
* } );
*
* setTimeout( function () {
* // Make the example container visible and recalculate the scroller sizes
* document.getElementById('container').style.display = "block";
* oTable.fnSettings().oScroller.fnMeasure();
* }, 3000 );
*/
"fnMeasure": function ( bRedraw )
{
if ( this.s.autoHeight )
{
this._fnCalcRowHeight();
}
this.s.viewportHeight = $(this.dom.scroller).height();
this.s.viewportRows = parseInt( this.s.viewportHeight/this.s.rowHeight, 10 )+1;
this.s.dt._iDisplayLength = this.s.viewportRows * this.s.displayBuffer;
if ( this.s.trace )
{
console.log(
'Row height: '+this.s.rowHeight +' '+
'Viewport height: '+this.s.viewportHeight +' '+
'Viewport rows: '+ this.s.viewportRows +' '+
'Display rows: '+ this.s.dt._iDisplayLength
);
}
if ( typeof bRedraw == 'undefined' || bRedraw )
{
this.s.dt.oInstance.fnDraw();
}
},
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Private methods (they are of course public in JS, but recommended as private)
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* Initialisation for Scroller
* @returns {void}
* @private
*/
"_fnConstruct": function ()
{
var that = this;
/* Insert a div element that we can use to force the DT scrolling container to
* the height that would be required if the whole table was being displayed
*/
this.dom.force.style.position = "absolute";
this.dom.force.style.top = "0px";
this.dom.force.style.left = "0px";
this.dom.force.style.width = "1px";
this.dom.scroller = $('div.'+this.s.dt.oClasses.sScrollBody, this.s.dt.nTableWrapper)[0];
this.dom.scroller.appendChild( this.dom.force );
this.dom.scroller.style.position = "relative";
this.dom.table = $('>table', this.dom.scroller)[0];
this.dom.table.style.position = "absolute";
this.dom.table.style.top = "0px";
this.dom.table.style.left = "0px";
// Add class to 'announce' that we are a Scroller table
$(this.s.dt.nTableWrapper).addClass('DTS');
// Add a 'loading' indicator
if ( this.s.loadingIndicator )
{
$(this.dom.scroller.parentNode)
.css('position', 'relative')
.append('<div class="DTS_Loading">'+this.s.dt.oLanguage.sLoadingRecords+'</div>');
}
/* Initial size calculations */
if ( this.s.rowHeight && this.s.rowHeight != 'auto' )
{
this.s.autoHeight = false;
}
this.fnMeasure( false );
/* Scrolling callback to see if a page change is needed */
$(this.dom.scroller).scroll( function () {
that._fnScroll.call( that );
} );
/* In iOS we catch the touchstart event incase the user tries to scroll
* while the display is already scrolling
*/
$(this.dom.scroller).bind('touchstart', function () {
that._fnScroll.call( that );
} );
/* Update the scroller when the DataTable is redrawn */
this.s.dt.aoDrawCallback.push( {
"fn": function () {
if ( that.s.dt.bInitialised ) {
that._fnDrawCallback.call( that );
}
},
"sName": "Scroller"
} );
/* Add a state saving parameter to the DT state saving so we can restore the exact
* position of the scrolling
*/
this.s.dt.oApi._fnCallbackReg( this.s.dt, 'aoStateSaveParams', function (oS, oData) {
oData.iScroller = that.dom.scroller.scrollTop;
}, "Scroller_State" );
},
/**
* Scrolling function - fired whenever the scrolling position is changed. This method needs
* to use the stored values to see if the table should be redrawn as we are moving towards
* the end of the information that is currently drawn or not. If needed, then it will redraw
* the table based on the new position.
* @returns {void}
* @private
*/
"_fnScroll": function ()
{
var
that = this,
iScrollTop = this.dom.scroller.scrollTop,
iTopRow;
/* If the table has been sorted or filtered, then we use the redraw that
* DataTables as done, rather than performing our own
*/
if ( this.s.dt.bFiltered || this.s.dt.bSorted )
{
return;
}
if ( this.s.trace )
{
console.log(
'Scroll: '+iScrollTop+'px - boundaries: '+this.s.redrawTop+' / '+this.s.redrawBottom+'. '+
' Showing rows '+this.fnPixelsToRow(iScrollTop)+
' to '+this.fnPixelsToRow(iScrollTop+$(this.dom.scroller).height())+
' in the viewport, with rows '+this.s.dt._iDisplayStart+
' to '+(this.s.dt._iDisplayEnd)+' rendered by the DataTable'
);
}
/* Update the table's information display for what is now in the viewport */
this._fnInfo();
/* We dont' want to state save on every scroll event - that's heavy handed, so
* use a timeout to update the state saving only when the scrolling has finished
*/
clearTimeout( this.s.stateTO );
this.s.stateTO = setTimeout( function () {
that.s.dt.oApi._fnSaveState( that.s.dt );
}, 250 );
/* Check if the scroll point is outside the trigger boundary which would required
* a DataTables redraw
*/
if ( iScrollTop < this.s.redrawTop || iScrollTop > this.s.redrawBottom )
{
var preRows = ((this.s.displayBuffer-1)/2) * this.s.viewportRows;
iTopRow = parseInt( iScrollTop / this.s.rowHeight, 10 ) - preRows;
if ( iTopRow < 0 )
{
/* At the start of the table */
iTopRow = 0;
}
else if ( iTopRow + this.s.dt._iDisplayLength > this.s.dt.fnRecordsDisplay() )
{
/* At the end of the table */
iTopRow = this.s.dt.fnRecordsDisplay() - this.s.dt._iDisplayLength;
if ( iTopRow < 0 )
{
iTopRow = 0;
}
}
else if ( iTopRow % 2 !== 0 )
{
/* For the row-striping classes (odd/even) we want only to start on evens
* otherwise the stripes will change between draws and look rubbish
*/
iTopRow++;
}
if ( iTopRow != this.s.dt._iDisplayStart )
{
/* Cache the new table position for quick lookups */
this.s.tableTop = $(this.s.dt.nTable).offset().top;
this.s.tableBottom = $(this.s.dt.nTable).height() + this.s.tableTop;
/* Do the DataTables redraw based on the calculated start point - note that when
* using server-side processing we introduce a small delay to not DoS the server...
*/
if ( this.s.dt.oFeatures.bServerSide ) {
clearTimeout( this.s.drawTO );
this.s.drawTO = setTimeout( function () {
that.s.dt._iDisplayStart = iTopRow;
that.s.dt.oApi._fnCalculateEnd( that.s.dt );
that.s.dt.oApi._fnDraw( that.s.dt );
}, this.s.serverWait );
}
else
{
this.s.dt._iDisplayStart = iTopRow;
this.s.dt.oApi._fnCalculateEnd( this.s.dt );
this.s.dt.oApi._fnDraw( this.s.dt );
}
if ( this.s.trace )
{
console.log( 'Scroll forcing redraw - top DT render row: '+ iTopRow );
}
}
}
},
/**
* Draw callback function which is fired when the DataTable is redrawn. The main function of
* this method is to position the drawn table correctly the scrolling container for the rows
* that is displays as a result of the scrolling position.
* @returns {void}
* @private
*/
"_fnDrawCallback": function ()
{
var
that = this,
iScrollTop = this.dom.scroller.scrollTop,
iScrollBottom = iScrollTop + this.s.viewportHeight;
/* Set the height of the scrolling forcer to be suitable for the number of rows
* in this draw
*/
this.dom.force.style.height = (this.s.rowHeight * this.s.dt.fnRecordsDisplay())+"px";
/* Calculate the position that the top of the table should be at */
var iTableTop = (this.s.rowHeight*this.s.dt._iDisplayStart);
if ( this.s.dt._iDisplayStart === 0 )
{
iTableTop = 0;
}
else if ( this.s.dt._iDisplayStart === this.s.dt.fnRecordsDisplay() - this.s.dt._iDisplayLength )
{
iTableTop = this.s.rowHeight * this.s.dt._iDisplayStart;
}
this.dom.table.style.top = iTableTop+"px";
/* Cache some information for the scroller */
this.s.tableTop = iTableTop;
this.s.tableBottom = $(this.s.dt.nTable).height() + this.s.tableTop;
this.s.redrawTop = iScrollTop - ( (iScrollTop - this.s.tableTop) * this.s.boundaryScale );
this.s.redrawBottom = iScrollTop + ( (this.s.tableBottom - iScrollBottom) * this.s.boundaryScale );
if ( this.s.trace )
{
console.log(
"Table redraw. Table top: "+iTableTop+"px "+
"Table bottom: "+this.s.tableBottom+" "+
"Scroll boundary top: "+this.s.redrawTop+" "+
"Scroll boundary bottom: "+this.s.redrawBottom+" "+
"Rows drawn: "+this.s.dt._iDisplayLength);
}
/* Because of the order of the DT callbacks, the info update will
* take precidence over the one we want here. So a 'thread' break is
* needed
*/
setTimeout( function () {
that._fnInfo.call( that );
}, 0 );
/* Restore the scrolling position that was saved by DataTable's state saving
* Note that this is done on the second draw when data is Ajax sourced, and the
* first draw when DOM soured
*/
if ( this.s.dt.oFeatures.bStateSave && this.s.dt.oLoadedState !== null &&
typeof this.s.dt.oLoadedState.iScroller != 'undefined' )
{
if ( (this.s.dt.sAjaxSource !== null && this.s.dt.iDraw == 2) ||
(this.s.dt.sAjaxSource === null && this.s.dt.iDraw == 1) )
{
setTimeout( function () {
$(that.dom.scroller).scrollTop( that.s.dt.oLoadedState.iScroller );
that.s.redrawTop = that.s.dt.oLoadedState.iScroller - (that.s.viewportHeight/2);
}, 0 );
}
}
},
/**
* Automatic calculation of table row height. This is just a little tricky here as using
* initialisation DataTables has tale the table out of the document, so we need to create
* a new table and insert it into the document, calculate the row height and then whip the
* table out.
* @returns {void}
* @private
*/
"_fnCalcRowHeight": function ()
{
var nTable = this.s.dt.nTable.cloneNode( false );
var nContainer = $(
'<div class="'+this.s.dt.oClasses.sWrapper+' DTS">'+
'<div class="'+this.s.dt.oClasses.sScrollWrapper+'">'+
'<div class="'+this.s.dt.oClasses.sScrollBody+'"></div>'+
'</div>'+
'</div>'
)[0];
$(nTable).append(
'<tbody>'+
'<tr>'+
'<td>&nbsp;</td>'+
'</tr>'+
'</tbody>'
);
$('div.'+this.s.dt.oClasses.sScrollBody, nContainer).append( nTable );
document.body.appendChild( nContainer );
this.s.rowHeight = $('tbody tr', nTable).outerHeight();
document.body.removeChild( nContainer );
},
/**
* Update any information elements that are controlled by the DataTable based on the scrolling
* viewport and what rows are visible in it. This function basically acts in the same way as
* _fnUpdateInfo in DataTables, and effectively replaces that function.
* @returns {void}
* @private
*/
"_fnInfo": function ()
{
if ( !this.s.dt.oFeatures.bInfo )
{
return;
}
var
dt = this.s.dt,
iScrollTop = this.dom.scroller.scrollTop,
iStart = this.fnPixelsToRow(iScrollTop)+1,
iMax = dt.fnRecordsTotal(),
iTotal = dt.fnRecordsDisplay(),
iPossibleEnd = this.fnPixelsToRow(iScrollTop+$(this.dom.scroller).height()),
iEnd = iTotal < iPossibleEnd ? iTotal : iPossibleEnd,
sStart = dt.fnFormatNumber( iStart ),
sEnd = dt.fnFormatNumber( iEnd ),
sMax = dt.fnFormatNumber( iMax ),
sTotal = dt.fnFormatNumber( iTotal ),
sOut;
if ( dt.fnRecordsDisplay() === 0 &&
dt.fnRecordsDisplay() == dt.fnRecordsTotal() )
{
/* Empty record set */
sOut = dt.oLanguage.sInfoEmpty+ dt.oLanguage.sInfoPostFix;
}
else if ( dt.fnRecordsDisplay() === 0 )
{
/* Rmpty record set after filtering */
sOut = dt.oLanguage.sInfoEmpty +' '+
dt.oLanguage.sInfoFiltered.replace('_MAX_', sMax)+
dt.oLanguage.sInfoPostFix;
}
else if ( dt.fnRecordsDisplay() == dt.fnRecordsTotal() )
{
/* Normal record set */
sOut = dt.oLanguage.sInfo.
replace('_START_', sStart).
replace('_END_', sEnd).
replace('_TOTAL_', sTotal)+
dt.oLanguage.sInfoPostFix;
}
else
{
/* Record set after filtering */
sOut = dt.oLanguage.sInfo.
replace('_START_', sStart).
replace('_END_', sEnd).
replace('_TOTAL_', sTotal) +' '+
dt.oLanguage.sInfoFiltered.replace('_MAX_',
dt.fnFormatNumber(dt.fnRecordsTotal()))+
dt.oLanguage.sInfoPostFix;
}
var n = dt.aanFeatures.i;
if ( typeof n != 'undefined' )
{
for ( var i=0, iLen=n.length ; i<iLen ; i++ )
{
$(n[i]).html( sOut );
}
}
}
};
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Statics
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* Scroller default settings for initialisation
* @namespace
* @static
*/
Scroller.oDefaults = {
/**
* Indicate if Scroller show show trace information on the console or not. This can be
* useful when debugging Scroller or if just curious as to what it is doing, but should
* be turned off for production.
* @type bool
* @default false
* @static
* @example
* var oTable = $('#example').dataTable( {
* "sScrollY": "200px",
* "sDom": "frtiS",
* "bDeferRender": true,
* "oScroller": {
* "trace": true
* }
* } );
*/
"trace": false,
/**
* Scroller will attempt to automatically calculate the height of rows for it's internal
* calculations. However the height that is used can be overridden using this parameter.
* @type int|string
* @default auto
* @static
* @example
* var oTable = $('#example').dataTable( {
* "sScrollY": "200px",
* "sDom": "frtiS",
* "bDeferRender": true,
* "oScroller": {
* "rowHeight": 30
* }
* } );
*/
"rowHeight": "auto",
/**
* When using server-side processing, Scroller will wait a small amount of time to allow
* the scrolling to finish before requesting more data from the server. This prevents
* you from DoSing your own server! The wait time can be configured by this parameter.
* @type int
* @default 200
* @static
* @example
* var oTable = $('#example').dataTable( {
* "sScrollY": "200px",
* "sDom": "frtiS",
* "bDeferRender": true,
* "oScroller": {
* "serverWait": 100
* }
* } );
*/
"serverWait": 200,
/**
* The display buffer is what Scroller uses to calculate how many rows it should pre-fetch
* for scrolling. Scroller automatically adjusts DataTables' display length to pre-fetch
* rows that will be shown in "near scrolling" (i.e. just beyond the current display area).
* The value is based upon the number of rows that can be displayed in the viewport (i.e.
* a value of 1), and will apply the display range to records before before and after the
* current viewport - i.e. a factor of 3 will allow Scroller to pre-fetch 1 viewport's worth
* of rows before the current viewport, the current viewport's rows and 1 viewport's worth
* of rows after the current viewport. Adjusting this value can be useful for ensuring
* smooth scrolling based on your data set.
* @type int
* @default 7
* @static
* @example
* var oTable = $('#example').dataTable( {
* "sScrollY": "200px",
* "sDom": "frtiS",
* "bDeferRender": true,
* "oScroller": {
* "displayBuffer": 10
* }
* } );
*/
"displayBuffer": 9,
/**
* Scroller uses the boundary scaling factor to decide when to redraw the table - which it
* typically does before you reach the end of the currently loaded data set (in order to
* allow the data to look continuous to a user scrolling through the data). If given as 0
* then the table will be redrawn whenever the viewport is scrolled, while 1 would not
* redraw the table until the currently loaded data has all been shown. You will want
* something in the middle - the default factor of 0.5 is usually suitable.
* @type float
* @default 0.5
* @static
* @example
* var oTable = $('#example').dataTable( {
* "sScrollY": "200px",
* "sDom": "frtiS",
* "bDeferRender": true,
* "oScroller": {
* "boundaryScale": 0.75
* }
* } );
*/
"boundaryScale": 0.5,
/**
* Show (or not) the loading element in the background of the table. Note that you should
* include the dataTables.scroller.css file for this to be displayed correctly.
* @type boolean
* @default false
* @static
* @example
* var oTable = $('#example').dataTable( {
* "sScrollY": "200px",
* "sDom": "frtiS",
* "bDeferRender": true,
* "oScroller": {
* "loadingIndicator": true
* }
* } );
*/
"loadingIndicator": false
};
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Constants
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* Name of this class
* @type String
* @default Scroller
* @static
*/
Scroller.prototype.CLASS = "Scroller";
/**
* Scroller version
* @type String
* @default See code
* @static
*/
Scroller.VERSION = "1.1.0";
Scroller.prototype.VERSION = Scroller.VERSION;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Initialisation
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Register a new feature with DataTables
*/
if ( typeof $.fn.dataTable == "function" &&
typeof $.fn.dataTableExt.fnVersionCheck == "function" &&
$.fn.dataTableExt.fnVersionCheck('1.9.0') )
{
$.fn.dataTableExt.aoFeatures.push( {
"fnInit": function( oDTSettings ) {
var init = (typeof oDTSettings.oInit.oScroller == 'undefined') ?
{} : oDTSettings.oInit.oScroller;
var oScroller = new Scroller( oDTSettings, init );
return oScroller.dom.wrapper;
},
"cFeature": "S",
"sFeature": "Scroller"
} );
}
else
{
alert( "Warning: Scroller requires DataTables 1.9.0 or greater - www.datatables.net/download");
}
// Attach Scroller to DataTables so it can be accessed as an 'extra'
$.fn.dataTable.Scroller = Scroller;
})(jQuery, window, document);

View File

@@ -0,0 +1,40 @@
/*
* File: dataTables.scroller.min.js
* Version: 1.1.0
* Author: Allan Jardine (www.sprymedia.co.uk)
*
* Copyright 2011 Allan Jardine, all rights reserved.
*
* This source file is free software, under either the GPL v2 license or a
* BSD (3 point) style license, as supplied with this software.
*
* This source file is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
*/
/*
GPL v2 or BSD 3 point style
@contact www.sprymedia.co.uk/contact
@copyright Copyright 2011-2012 Allan Jardine, all rights reserved.
This source file is free software, under either the GPL v2 license or a
BSD style license, available at:
http://datatables.net/license_gpl2
http://datatables.net/license_bsd
*/
(function(d,h,g){var e=function(a,b){!this instanceof e?alert("Scroller warning: Scroller must be initialised with the 'new' keyword."):("undefined"==typeof b&&(b={}),this.s={dt:a,tableTop:0,tableBottom:0,redrawTop:0,redrawBottom:0,rowHeight:null,autoHeight:!0,viewportHeight:0,viewportRows:0,stateTO:null,drawTO:null},this.s=d.extend(this.s,e.oDefaults,b),this.dom={force:g.createElement("div"),scroller:null,table:null},this.s.dt.oScroller=this,this._fnConstruct())};e.prototype={fnRowToPixels:function(a){return a*
this.s.rowHeight},fnPixelsToRow:function(a){return parseInt(a/this.s.rowHeight,10)},fnScrollToRow:function(a,b){var c=this.fnRowToPixels(a);"undefined"==typeof b||b?d(this.dom.scroller).animate({scrollTop:c}):d(this.dom.scroller).scrollTop(c)},fnMeasure:function(a){this.s.autoHeight&&this._fnCalcRowHeight();this.s.viewportHeight=d(this.dom.scroller).height();this.s.viewportRows=parseInt(this.s.viewportHeight/this.s.rowHeight,10)+1;this.s.dt._iDisplayLength=this.s.viewportRows*this.s.displayBuffer;
this.s.trace&&console.log("Row height: "+this.s.rowHeight+" Viewport height: "+this.s.viewportHeight+" Viewport rows: "+this.s.viewportRows+" Display rows: "+this.s.dt._iDisplayLength);("undefined"==typeof a||a)&&this.s.dt.oInstance.fnDraw()},_fnConstruct:function(){var a=this;this.dom.force.style.position="absolute";this.dom.force.style.top="0px";this.dom.force.style.left="0px";this.dom.force.style.width="1px";this.dom.scroller=d("div."+this.s.dt.oClasses.sScrollBody,this.s.dt.nTableWrapper)[0];
this.dom.scroller.appendChild(this.dom.force);this.dom.scroller.style.position="relative";this.dom.table=d(">table",this.dom.scroller)[0];this.dom.table.style.position="absolute";this.dom.table.style.top="0px";this.dom.table.style.left="0px";d(this.s.dt.nTableWrapper).addClass("DTS");this.s.loadingIndicator&&d(this.dom.scroller.parentNode).css("position","relative").append('<div class="DTS_Loading">'+this.s.dt.oLanguage.sLoadingRecords+"</div>");this.s.rowHeight&&"auto"!=this.s.rowHeight&&(this.s.autoHeight=
!1);this.fnMeasure(!1);d(this.dom.scroller).scroll(function(){a._fnScroll.call(a)});d(this.dom.scroller).bind("touchstart",function(){a._fnScroll.call(a)});this.s.dt.aoDrawCallback.push({fn:function(){a.s.dt.bInitialised&&a._fnDrawCallback.call(a)},sName:"Scroller"});this.s.dt.oApi._fnCallbackReg(this.s.dt,"aoStateSaveParams",function(b,c){c.iScroller=a.dom.scroller.scrollTop},"Scroller_State")},_fnScroll:function(){var a=this,b=this.dom.scroller.scrollTop,c;if(!this.s.dt.bFiltered&&!this.s.dt.bSorted&&
(this.s.trace&&console.log("Scroll: "+b+"px - boundaries: "+this.s.redrawTop+" / "+this.s.redrawBottom+". Showing rows "+this.fnPixelsToRow(b)+" to "+this.fnPixelsToRow(b+d(this.dom.scroller).height())+" in the viewport, with rows "+this.s.dt._iDisplayStart+" to "+this.s.dt._iDisplayEnd+" rendered by the DataTable"),this._fnInfo(),clearTimeout(this.s.stateTO),this.s.stateTO=setTimeout(function(){a.s.dt.oApi._fnSaveState(a.s.dt)},250),b<this.s.redrawTop||b>this.s.redrawBottom)){var f=(this.s.displayBuffer-
1)/2*this.s.viewportRows;c=parseInt(b/this.s.rowHeight,10)-f;0>c?c=0:c+this.s.dt._iDisplayLength>this.s.dt.fnRecordsDisplay()?(c=this.s.dt.fnRecordsDisplay()-this.s.dt._iDisplayLength,0>c&&(c=0)):0!==c%2&&c++;c!=this.s.dt._iDisplayStart&&(this.s.tableTop=d(this.s.dt.nTable).offset().top,this.s.tableBottom=d(this.s.dt.nTable).height()+this.s.tableTop,this.s.dt.oFeatures.bServerSide?(clearTimeout(this.s.drawTO),this.s.drawTO=setTimeout(function(){a.s.dt._iDisplayStart=c;a.s.dt.oApi._fnCalculateEnd(a.s.dt);
a.s.dt.oApi._fnDraw(a.s.dt)},this.s.serverWait)):(this.s.dt._iDisplayStart=c,this.s.dt.oApi._fnCalculateEnd(this.s.dt),this.s.dt.oApi._fnDraw(this.s.dt)),this.s.trace&&console.log("Scroll forcing redraw - top DT render row: "+c))}},_fnDrawCallback:function(){var a=this,b=this.dom.scroller.scrollTop,c=b+this.s.viewportHeight;this.dom.force.style.height=this.s.rowHeight*this.s.dt.fnRecordsDisplay()+"px";var f=this.s.rowHeight*this.s.dt._iDisplayStart;0===this.s.dt._iDisplayStart?f=0:this.s.dt._iDisplayStart===
this.s.dt.fnRecordsDisplay()-this.s.dt._iDisplayLength&&(f=this.s.rowHeight*this.s.dt._iDisplayStart);this.dom.table.style.top=f+"px";this.s.tableTop=f;this.s.tableBottom=d(this.s.dt.nTable).height()+this.s.tableTop;this.s.redrawTop=b-(b-this.s.tableTop)*this.s.boundaryScale;this.s.redrawBottom=b+(this.s.tableBottom-c)*this.s.boundaryScale;this.s.trace&&console.log("Table redraw. Table top: "+f+"px Table bottom: "+this.s.tableBottom+" Scroll boundary top: "+this.s.redrawTop+" Scroll boundary bottom: "+
this.s.redrawBottom+" Rows drawn: "+this.s.dt._iDisplayLength);setTimeout(function(){a._fnInfo.call(a)},0);this.s.dt.oFeatures.bStateSave&&null!==this.s.dt.oLoadedState&&"undefined"!=typeof this.s.dt.oLoadedState.iScroller&&(null!==this.s.dt.sAjaxSource&&2==this.s.dt.iDraw||null===this.s.dt.sAjaxSource&&1==this.s.dt.iDraw)&&setTimeout(function(){d(a.dom.scroller).scrollTop(a.s.dt.oLoadedState.iScroller);a.s.redrawTop=a.s.dt.oLoadedState.iScroller-a.s.viewportHeight/2},0)},_fnCalcRowHeight:function(){var a=
this.s.dt.nTable.cloneNode(!1),b=d('<div class="'+this.s.dt.oClasses.sWrapper+' DTS"><div class="'+this.s.dt.oClasses.sScrollWrapper+'"><div class="'+this.s.dt.oClasses.sScrollBody+'"></div></div></div>')[0];d(a).append("<tbody><tr><td>&nbsp;</td></tr></tbody>");d("div."+this.s.dt.oClasses.sScrollBody,b).append(a);g.body.appendChild(b);this.s.rowHeight=d("tbody tr",a).outerHeight();g.body.removeChild(b)},_fnInfo:function(){if(this.s.dt.oFeatures.bInfo){var a=this.s.dt,b=this.dom.scroller.scrollTop,
c=this.fnPixelsToRow(b)+1,f=a.fnRecordsTotal(),e=a.fnRecordsDisplay(),b=this.fnPixelsToRow(b+d(this.dom.scroller).height()),b=e<b?e:b,c=a.fnFormatNumber(c),b=a.fnFormatNumber(b),f=a.fnFormatNumber(f),e=a.fnFormatNumber(e),e=0===a.fnRecordsDisplay()&&a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfoEmpty+a.oLanguage.sInfoPostFix:0===a.fnRecordsDisplay()?a.oLanguage.sInfoEmpty+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",f)+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()==a.fnRecordsTotal()?
a.oLanguage.sInfo.replace("_START_",c).replace("_END_",b).replace("_TOTAL_",e)+a.oLanguage.sInfoPostFix:a.oLanguage.sInfo.replace("_START_",c).replace("_END_",b).replace("_TOTAL_",e)+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal()))+a.oLanguage.sInfoPostFix,a=a.aanFeatures.i;if("undefined"!=typeof a){f=0;for(c=a.length;f<c;f++)d(a[f]).html(e)}}}};e.oDefaults={trace:!1,rowHeight:"auto",serverWait:200,displayBuffer:9,boundaryScale:0.5,loadingIndicator:!1};e.prototype.CLASS=
"Scroller";e.VERSION="1.1.0";e.prototype.VERSION=e.VERSION;"function"==typeof d.fn.dataTable&&"function"==typeof d.fn.dataTableExt.fnVersionCheck&&d.fn.dataTableExt.fnVersionCheck("1.9.0")?d.fn.dataTableExt.aoFeatures.push({fnInit:function(a){return(new e(a,"undefined"==typeof a.oInit.oScroller?{}:a.oInit.oScroller)).dom.wrapper},cFeature:"S",sFeature:"Scroller"}):alert("Warning: Scroller requires DataTables 1.9.0 or greater - www.datatables.net/download");d.fn.dataTable.Scroller=e})(jQuery,window,
document);