Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Data Tables test</title>
- <script src="http://code.jquery.com/jquery-2.1.4.min.js" type="text/javascript"></script>
- <!--<script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>-->
- <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js" type="text/javascript"></script>
- <link href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css"/>
- <script src="http://cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js" type="text/javascript"></script>
- <script src="https://cdn.datatables.net/plug-ins/1.10.7/integration/jqueryui/dataTables.jqueryui.js" type="text/javascript"></script>
- <link href="https://cdn.datatables.net/plug-ins/1.10.7/integration/jqueryui/dataTables.jqueryui.css" rel="stylesheet" type="text/css"/>
- <script src="http://jquery-datatables-row-reordering.googlecode.com/svn/trunk/media/js/jquery.dataTables.rowReordering.js" type="text/javascript"></script>
- <script type='text/javascript'>
- $(function()
- {
- $("#mySuperTable").dataTable(
- {
- // method below is needed to fix the error: "Error: Syntax error, unrecognized expression: #":
- // http://datatables.net/forums/discussion/19011/drag-and-drop-row-reordering-issue
- "fnRowCallback": function (nRow, aData, iDisplayIndex)
- {
- nRow.setAttribute('id', aData.RowOrder); //Initialize row id for every row
- }
- ,"aaSorting" : [] // thought sorting was the problem, but it's not.
- }).rowReordering();
- });
- </script>
- </head>
- <body>
- <table id="mySuperTable">
- <thead>
- <tr>
- <th>Name</th>
- <th>Address</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>Mary Sue</td>
- <td>123 South st.</td>
- </tr>
- <tr>
- <td>Anthony Jones</td>
- <td>321 East st.</td>
- </tr>
- <tr>
- <td>Jamie Lanister</td>
- <td>98 King's Landing Ave.</td>
- </tr>
- <tr>
- <td>Donald Duck</td>
- <td>54 Disney Dr.</td>
- </tr>
- </tbody>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement