Samuel Dauzon
Samuel Dauzon

Reputation: 11334

jquery datatable 1.9.4 sAjaxSource reload data

I use old datatable version (not by choice) and I try to create a datatable with an AJAX source.

Here is my JS Code :

var dataTable = $('#my_table').DataTable( {
    "bProcessing": true,
    "bServerSide": true,
    "bJQueryUI" : true,
    "fnReloadAjax" : true,
    "sAjaxSource": "http://localhost:8000/ajax_data"
});

Here is the table :

<table id="failover_record">
    <thead>
        <tr>
            <th>Name</th>
            <th>Email</th>
        </tr>
    </thead>
</table>

The table is right filled by Datatable after the AJAX query.

My problem is : When I write text to filter the result the table hasn't reload.

I have no error message.

Do youy have any idea why Datatable ignores the server responses ?

Upvotes: 0

Views: 1596

Answers (2)

Samuel Dauzon
Samuel Dauzon

Reputation: 11334

I found the error, I disabled bServerSide with the following line :

"bServerSide": true,

and it works.

The line can be removed because default value of bServerSide is false.

I hope it will helps someone else.

Upvotes: 1

Gyrocode.com
Gyrocode.com

Reputation: 58900

Server-side response will be ignored if value of sEcho parameter in response doesn't match value of sEcho parameter in request.

From the manual:

Reply from the server

sEcho - An unaltered copy of sEcho sent from the client side. This parameter will change with each draw (it is basically a draw count) - so it is important that this is implemented.

Upvotes: 0

Related Questions