1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-03-15 16:29:16 +01:00

Fixed: Remove the 'sNames' parameter that was introduced for server-side processing in 1.7.4. The parameter 'sColumns' actually performs exactly this task already. Doh. Also update the example PHP to take this into account - 3218

This commit is contained in:
Allan Jardine 2010-10-31 17:16:35 +00:00
parent e4e2b0d11b
commit eec881b8ac
2 changed files with 3 additions and 11 deletions

View File

@ -8,13 +8,13 @@
* *
* 1. Data from server to client - notice that the $aColumns array below is in a different * 1. Data from server to client - notice that the $aColumns array below is in a different
* order to that from the array in server_processing.php, but DataTables will render the * order to that from the array in server_processing.php, but DataTables will render the
* table in the same order. This reordering is done on the client-side by using the sNames * table in the same order. This reordering is done on the client-side by using the sColumns
* parameter which is passed back, stating the order which the server is sending data back in. * parameter which is passed back, stating the order which the server is sending data back in.
* DataTables will compaire this to the sName parameter for each column and reorder as needed. * DataTables will compaire this to the sName parameter for each column and reorder as needed.
* *
* 2. Data from client to server - in order that the columns can be sent to the server in * 2. Data from client to server - in order that the columns can be sent to the server in
* any order (it is expected in this script that the server-side will always work with a static * any order (it is expected in this script that the server-side will always work with a static
* array which is not reordered dynamically) DataTables will send the parameter 'sNames' which * array which is not reordered dynamically) DataTables will send the parameter 'sColumns' which
* like it's return counterpart is a comma seperated list of the column names, telling the * like it's return counterpart is a comma seperated list of the column names, telling the
* server-side what order the columns are being shown on the client-side. As such it is now * server-side what order the columns are being shown on the client-side. As such it is now
* possible to realise what column sSearch_{i} (for example) refers to. This is done by a look * possible to realise what column sSearch_{i} (for example) refers to. This is done by a look
@ -66,7 +66,7 @@
/* /*
* Names - this is specific to server-side column re-ordering * Names - this is specific to server-side column re-ordering
*/ */
$aNames = explode( ',', $_GET['sNames'] ); $aNames = explode( ',', $_GET['sColumns'] );
/* /*

View File

@ -3162,14 +3162,6 @@
aoData.push( { "name": "iDisplayLength", "value": oSettings.oFeatures.bPaginate !== false ? aoData.push( { "name": "iDisplayLength", "value": oSettings.oFeatures.bPaginate !== false ?
oSettings._iDisplayLength : -1 } ); oSettings._iDisplayLength : -1 } );
/* Column names */
var aNames = [];
for ( i=0 ; i<iColumns ; i++ )
{
aNames.push( oSettings.aoColumns[i].sName );
}
aoData.push( { "name": "sNames", "value": aNames.join(',') } );
/* Filtering */ /* Filtering */
if ( oSettings.oFeatures.bFilter !== false ) if ( oSettings.oFeatures.bFilter !== false )
{ {