PageRenderTime 41ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/extras/data_table/extensions/ColReorder/examples/integration/server_side.html

https://gitlab.com/gustCL/syscar
HTML | 233 lines | 226 code | 7 blank | 0 comment | 0 complexity | aecb974ff16daf27ef5d1d981cdda046 MD5 | raw file
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
  6. <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
  7. <title>ColReorder example - Server-side processing</title>
  8. <link rel="stylesheet" type="text/css" href="../../../../media/css/jquery.dataTables.css">
  9. <link rel="stylesheet" type="text/css" href="../../css/colReorder.dataTables.css">
  10. <link rel="stylesheet" type="text/css" href="../../../../examples/resources/syntax/shCore.css">
  11. <link rel="stylesheet" type="text/css" href="../../../../examples/resources/demo.css">
  12. <style type="text/css" class="init">
  13. </style>
  14. <script type="text/javascript" language="javascript" src="//code.jquery.com/jquery-1.12.0.min.js">
  15. </script>
  16. <script type="text/javascript" language="javascript" src="../../../../media/js/jquery.dataTables.js">
  17. </script>
  18. <script type="text/javascript" language="javascript" src="../../js/dataTables.colReorder.js">
  19. </script>
  20. <script type="text/javascript" language="javascript" src="../../../../examples/resources/syntax/shCore.js">
  21. </script>
  22. <script type="text/javascript" language="javascript" src="../../../../examples/resources/demo.js">
  23. </script>
  24. <script type="text/javascript" language="javascript" class="init">
  25. $(document).ready(function() {
  26. $('#example').dataTable( {
  27. processing: true,
  28. serverSide: true,
  29. ajax: "../../../../examples/server_side/scripts/objects.php",
  30. columns: [
  31. { data: "first_name" },
  32. { data: "last_name" },
  33. { data: "position" },
  34. { data: "office" },
  35. { data: "start_date" },
  36. { data: "salary" }
  37. ],
  38. colReorder: true
  39. } );
  40. } );
  41. </script>
  42. </head>
  43. <body class="dt-example">
  44. <div class="container">
  45. <section>
  46. <h1>ColReorder example <span>Server-side processing</span></h1>
  47. <div class="info">
  48. <p>Server-side processing can be exceptionally useful in DataTables when dealing with massive data sets, and ColReorder works with this as would be expected.</p>
  49. <p>It is recommend that you use object based data with server-side processing and ColReorder, as this provides easily understandable mapping between the the
  50. columns and the data relation on the server, otherwise you need to work out array indexes on each call!</p>
  51. </div>
  52. <table id="example" class="display" cellspacing="0" width="100%">
  53. <thead>
  54. <tr>
  55. <th>First name</th>
  56. <th>Last name</th>
  57. <th>Position</th>
  58. <th>Office</th>
  59. <th>Start date</th>
  60. <th>Salary</th>
  61. </tr>
  62. </thead>
  63. <tfoot>
  64. <tr>
  65. <th>First name</th>
  66. <th>Last name</th>
  67. <th>Position</th>
  68. <th>Office</th>
  69. <th>Start date</th>
  70. <th>Salary</th>
  71. </tr>
  72. </tfoot>
  73. </table>
  74. <ul class="tabs">
  75. <li class="active">Javascript</li>
  76. <li>HTML</li>
  77. <li>CSS</li>
  78. <li>Ajax</li>
  79. <li>Server-side script</li>
  80. </ul>
  81. <div class="tabs">
  82. <div class="js">
  83. <p>The Javascript shown below is used to initialise the table shown in this example:</p><code class="multiline language-js">$(document).ready(function() {
  84. $('#example').dataTable( {
  85. processing: true,
  86. serverSide: true,
  87. ajax: &quot;../../../../examples/server_side/scripts/objects.php&quot;,
  88. columns: [
  89. { data: &quot;first_name&quot; },
  90. { data: &quot;last_name&quot; },
  91. { data: &quot;position&quot; },
  92. { data: &quot;office&quot; },
  93. { data: &quot;start_date&quot; },
  94. { data: &quot;salary&quot; }
  95. ],
  96. colReorder: true
  97. } );
  98. } );</code>
  99. <p>In addition to the above code, the following Javascript library files are loaded for use in this example:</p>
  100. <ul>
  101. <li>
  102. <a href="//code.jquery.com/jquery-1.12.0.min.js">//code.jquery.com/jquery-1.12.0.min.js</a>
  103. </li>
  104. <li>
  105. <a href="../../../../media/js/jquery.dataTables.js">../../../../media/js/jquery.dataTables.js</a>
  106. </li>
  107. <li>
  108. <a href="../../js/dataTables.colReorder.js">../../js/dataTables.colReorder.js</a>
  109. </li>
  110. </ul>
  111. </div>
  112. <div class="table">
  113. <p>The HTML shown below is the raw HTML table element, before it has been enhanced by DataTables:</p>
  114. </div>
  115. <div class="css">
  116. <div>
  117. <p>This example uses a little bit of additional CSS beyond what is loaded from the library files (below), in order to correctly display the table. The
  118. additional CSS used is shown below:</p><code class="multiline language-css"></code>
  119. </div>
  120. <p>The following CSS library files are loaded for use in this example to provide the styling of the table:</p>
  121. <ul>
  122. <li>
  123. <a href="../../../../media/css/jquery.dataTables.css">../../../../media/css/jquery.dataTables.css</a>
  124. </li>
  125. <li>
  126. <a href="../../css/colReorder.dataTables.css">../../css/colReorder.dataTables.css</a>
  127. </li>
  128. </ul>
  129. </div>
  130. <div class="ajax">
  131. <p>This table loads data by Ajax. The latest data that has been loaded is shown below. This data will update automatically as any additional data is
  132. loaded.</p>
  133. </div>
  134. <div class="php">
  135. <p>The script used to perform the server-side processing for this table is shown below. Please note that this is just an example script using PHP. Server-side
  136. processing scripts can be written in any language, using <a href="//datatables.net/manual/server-side">the protocol described in the DataTables
  137. documentation</a>.</p>
  138. </div>
  139. </div>
  140. </section>
  141. </div>
  142. <section>
  143. <div class="footer">
  144. <div class="gradient"></div>
  145. <div class="liner">
  146. <h2>Other examples</h2>
  147. <div class="toc">
  148. <div class="toc-group">
  149. <h3><a href="../initialisation/index.html">Initialisation and options</a></h3>
  150. <ul class="toc">
  151. <li>
  152. <a href="../initialisation/simple.html">Basic initialisation</a>
  153. </li>
  154. <li>
  155. <a href="../initialisation/scrolling.html">Scrolling table</a>
  156. </li>
  157. <li>
  158. <a href="../initialisation/predefined.html">Predefined column ordering</a>
  159. </li>
  160. <li>
  161. <a href="../initialisation/realtime.html">Realtime updating</a>
  162. </li>
  163. <li>
  164. <a href="../initialisation/col_filter.html">Individual column filtering</a>
  165. </li>
  166. <li>
  167. <a href="../initialisation/new_init.html">Initialisation using `new`</a>
  168. </li>
  169. <li>
  170. <a href="../initialisation/reset.html">Reset ordering API</a>
  171. </li>
  172. </ul>
  173. </div>
  174. <div class="toc-group">
  175. <h3><a href="./index.html">Integration with other DataTables extensions</a></h3>
  176. <ul class="toc active">
  177. <li>
  178. <a href="./colvis.html">Column visibility integration</a>
  179. </li>
  180. <li>
  181. <a href="./fixedcolumns.html">FixedColumns integration</a>
  182. </li>
  183. <li>
  184. <a href="./fixedheader.html">FixedHeader integration</a>
  185. </li>
  186. <li>
  187. <a href="./responsive.html">Responsive integration</a>
  188. </li>
  189. <li class="active">
  190. <a href="./server_side.html">Server-side processing</a>
  191. </li>
  192. <li>
  193. <a href="./state_save.html">State saving</a>
  194. </li>
  195. </ul>
  196. </div>
  197. <div class="toc-group">
  198. <h3><a href="../styling/index.html">Styling</a></h3>
  199. <ul class="toc">
  200. <li>
  201. <a href="../styling/alt_insert.html">Alternative insert styling</a>
  202. </li>
  203. <li>
  204. <a href="../styling/bootstrap.html">Bootstrap styling</a>
  205. </li>
  206. <li>
  207. <a href="../styling/foundation.html">Foundation styling</a>
  208. </li>
  209. <li>
  210. <a href="../styling/jqueryui.html">jQuery UI styling</a>
  211. </li>
  212. </ul>
  213. </div>
  214. </div>
  215. <div class="epilogue">
  216. <p>Please refer to the <a href="http://www.datatables.net">DataTables documentation</a> for full information about its API properties and methods.<br>
  217. Additionally, there are a wide range of <a href="http://www.datatables.net/extensions">extensions</a> and <a href=
  218. "http://www.datatables.net/plug-ins">plug-ins</a> which extend the capabilities of DataTables.</p>
  219. <p class="copyright">DataTables designed and created by <a href="http://www.sprymedia.co.uk">SpryMedia Ltd</a> © 2007-2016<br>
  220. DataTables is licensed under the <a href="http://www.datatables.net/mit">MIT license</a>.</p>
  221. </div>
  222. </div>
  223. </div>
  224. </section>
  225. </body>
  226. </html>