From fbab63b7b5dc658a508bfc912504e8d17109133a Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Sat, 21 Jan 2012 07:43:47 +0000 Subject: [PATCH] Removed: Column reordering example using sName - it is much better to use mDataProp for this kind of thing now and column reordering is depricated in the 1.9 release of DataTables, so remove the example showing how it might be done to stop new users using it. --- examples/server_side/column_ordering.html | 228 ---------------------- examples/server_side/scripts/ordering.php | 206 ------------------- 2 files changed, 434 deletions(-) delete mode 100644 examples/server_side/column_ordering.html delete mode 100644 examples/server_side/scripts/ordering.php diff --git a/examples/server_side/column_ordering.html b/examples/server_side/column_ordering.html deleted file mode 100644 index cd16d4aa..00000000 --- a/examples/server_side/column_ordering.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - DataTables example - - - - - - -
-
- DataTables server-side column ordering example -
- -

Preamble

-

When using server-side processing it may be considerably easier on the server-side to output the data in an order which is not exactly that shown by the table to the end user. For this reason you can 'name' each column and this information will be sent to the server (comma delimited) as the variable 'sColumns' - this is the column information that DataTables expects to get back from a request.

-

Equally there you can defined an 'sColumns' in the JSON return which tells DataTables the order of the columns that has been returned. If the order is different from what it expects, then it will automatically re-order for you. The following example shows a server-side return which gives the columns "out of order".

- -

Live example

-
- - - - - - - - - - - - - - - - - - - - - - - - -
Rendering engineBrowserPlatform(s)Engine versionCSS grade
Loading data from server
Rendering engineBrowserPlatform(s)Engine versionCSS grade
-
-
- - -

Initialisation code

-
$(document).ready(function() {
-	$('#example').dataTable( {
-		"bProcessing": true,
-		"bServerSide": true,
-		"sAjaxSource": "scripts/ordering.php",
-		"aoColumns": [
-			{ "sName": "engine" },
-			{ "sName": "browser" },
-			{ "sName": "platform" },
-			{ "sName": "version" },
-			{ "sName": "grade" }
-		]
-	} );
-} );
- - - -

Server response

-

The code below shows the latest JSON data that has been returned from the server in response to the Ajax request made by DataTables. This will update as further requests are made.

-

-			
-			
-			

Other examples

- - - - - - -
- - \ No newline at end of file diff --git a/examples/server_side/scripts/ordering.php b/examples/server_side/scripts/ordering.php deleted file mode 100644 index 327e98ea..00000000 --- a/examples/server_side/scripts/ordering.php +++ /dev/null @@ -1,206 +0,0 @@ - intval($_GET['sEcho']), - "sColumns" => implode( ',', $aColumns ), - "iTotalRecords" => $iTotal, - "iTotalDisplayRecords" => $iFilteredTotal, - "aaData" => array() - ); - - while ( $aRow = mysql_fetch_array( $rResult ) ) - { - $row = array(); - for ( $i=0 ; $i \ No newline at end of file