Server side Ajax sorting is iSortCol_0 based on hiddend columns?

I do not know if this is an error, but I have datatable + ajax with the following parameters:

     "bServerSide": true,
     "sAjaxSource": url,
     "fnServerData": function (sSource, aoData, fnCallback) {
        jQuery.ajax({
           "dataType": 'json',
           "type": "POST",
           "url": sSource,
           "data": aoData,
           "success": fnCallback
        });
     },
     "sPaginationType": "bootstrap",
     "aoColumns": [
                    { "sName": "Id", "sType": 'numeric', "bVisible": false },
                    { "sName": "PostingDate", "sType": 'Date' },
                    { "sName": "Userid", "sType": 'string', "bVisible": false },
                    { "sName": "DisplayName" },
                    { "sName": "Description" },
                    { "sName": "MainTag" },
                    { "sName": "Tags" },
                    { "sName": "HowMuch" }
                ]

I have a form in which users can add rows, and when they submit it, I add data to the database using an ajax call and then call: JQuery ('# mydatatable') DataTable () fnReloadAjax (); ..

When the user clicks to sort the table by the "MainTag" column, my ajax server side gets:

iSortCol_0 4
iSortingCols 1

And all bSortable_ # is, right from 0 to 7 (I have 8 columns, as shown above.

, iSortCol_0 , , , , , iSortCol_0 = 4, .

, , , , , - , .

+5
1

, , , fnServerParams() ( this), , .

    "fnServerParams": function ( aoData ) {
        aoData.push( { "name": "more_data", "value": "my_value" } );
    }
+4
source

All Articles