state_saving.html 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  5. <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" />
  6. <title>DataTables example</title>
  7. <style type="text/css">
  8. @import "../../media/css/demo_page.css";
  9. @import "../../media/css/demo_table.css";
  10. @import "media/css/dataTables.scroller.css";
  11. </style>
  12. <script type="text/javascript" language="javascript" src="../../media/js/jquery.js"></script>
  13. <script type="text/javascript" language="javascript" src="../../media/js/jquery.dataTables.js"></script>
  14. <script type="text/javascript" language="javascript" src="media/js/dataTables.scroller.js"></script>
  15. <script type="text/javascript" charset="utf-8">
  16. $(document).ready(function() {
  17. var oTable = $('#example').dataTable( {
  18. "sScrollY": "200px",
  19. "sAjaxSource": "media/data/2500.txt",
  20. "sDom": "frtiS",
  21. "bDeferRender": true,
  22. "bStateSave": true
  23. } );
  24. } );
  25. </script>
  26. </head>
  27. <body id="dt_example">
  28. <div id="container" style="width:980px">
  29. <div class="full_width big">
  30. Scroller with state saving
  31. </div>
  32. <h1>Preamble</h1>
  33. <p>Scroller will automatically integrate with DataTables in order to save the scrolling position of the table, if state saving is enabled in the DataTable (bStateSave). This example shows that in practice - to demonstrate, scroll the table and then reload the page.</p>
  34. <h1>Live example</h1>
  35. <div id="demo">
  36. <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
  37. <thead>
  38. <tr>
  39. <th>ID</th>
  40. <th>First name</th>
  41. <th>Last name</th>
  42. <th>ZIP</th>
  43. <th width="33%">Country</th>
  44. </tr>
  45. </thead>
  46. </table>
  47. </div>
  48. <div class="spacer"></div>
  49. <h1>Initialisation code</h1>
  50. <pre>$(document).ready(function() {
  51. var oTable = $('#example').dataTable( {
  52. "sScrollY": "200px",
  53. "sAjaxSource": "media/data/2500.txt",
  54. "sDom": "frtiS",
  55. "bDeferRender": true,
  56. "bStateSave": true
  57. } );
  58. } );</pre>
  59. <h1>Other examples</h1>
  60. <div class="demo_links">
  61. <ul>
  62. <li><a href="index.html">Basic initialisation of Scroller</a></li>
  63. <li><a href="state_saving.html">State saving</a></li>
  64. <li><a href="api_scrolling.html">API - pragmatically move to a row</a></li>
  65. <li><a href="server-side_processing.html">Server-side processing with Scroller</a></li>
  66. <li><a href="large_js_source.html">50'000 rows in a table - client-side generated data</a></li>
  67. </ul>
  68. </div>
  69. </div>
  70. </body>
  71. </html>