0

When "serverSide: true" then the search option works not perfectly.

My table has 5000+ records, I'm using "serverSide: true" for fast data load, but the search not working. Again when using serverSide: false then the search works perfectly but the data loading slowly.

myTable = $('#myTable').DataTable({
        processing: true,
        serverSide: true,
        searching: true,
        ajax: {
            url: "{{ $url }}",
            dataType: "json",
            type: "POST",
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            data: function (d) {
                d.table = 1
                d.code = $('#code').val()
            }
        },
        columns: [
            {data: 'actions'},
            {data: 'id'},
            {data: 'code'},
        ],
        dom: 'lBfrtip',
        buttons: datatable_buttons,
        order: [],
        columnDefs: [
            {
                orderable: false,
                targets: 0
            }
        ],
    })

I want to show data fast and search working perfectly.

0 Answers0