There is two times ajax request when follwing cdn used .

There is two times ajax request when follwing cdn used .

core_javacore_java Posts: 13Questions: 4Answers: 0

-> //cdn.datatables.net/1.10.15/css/dataTables.bootstrap.min.css
-> //cdn.datatables.net/1.10.15/css/jquery.dataTables.min.css
-> //cdn.datatables.net/responsive/2.2.0/css/responsive.bootstrap.min.css
-> //cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js
-> //cdn.datatables.net/1.10.15/js/dataTables.bootstrap.min.js
-> //cdn.datatables.net/responsive/2.2.0/js/dataTables.responsive.min.js
-> //cdn.datatables.net/responsive/2.2.0/js/responsive.bootstrap.min.js

Two times Server Side Request happened and slow request.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,357Questions: 26Answers: 4,956

    What is your JS code for Datatables?

    Are the two requests the same?

    What do you mean by "slow request"?

    Kevin

  • core_javacore_java Posts: 13Questions: 4Answers: 0

    $('#table_id').DataTable({
    'dom': "<'row'<'col-sm-4'l B><'col-sm-8'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",
    'buttons': [],
    'pageLength': 10,
    'responsive': true,
    "processing": true,
    "serverSide": true,
    "deferRender": true,
    "pagingType": "full_numbers",
    "ajax": {
    "type": 'POST',
    "url": 'URL',
    },
    "stateSave": true,
    "oLanguage": {
    "sSearch": "",
    // "sLengthMenu": "",
    'oPaginate': {
    'sFirst': '<a href="#" title="First"><i class="fa fa-angle-double-left"></i></a>',
    'sLast': '<a href="#" title="Last"><i class="fa fa-angle-double-right"></i></a>',
    'sNext': '<a href="#" title="Next"><i class="fa fa-angle-right"></i></a>',
    'sPrevious': '<a href="#" title="Previous"><i class="fa fa-angle-left"></i></a>',
    }
    },
    "lengthMenu": [
    [10, 50, 100, -1],
    [10, 50, 100, "All"]
    ],
    'order': [[0, "asc"]],
    'searchDelay': 350,
    });

    When page loads two times from responsive.js and datatable.js request generated as per stack from ajax request.

    Second request takes double seconds then first request.

    First request initiate from responsive.js from _resize method
    Second request from as normal datatable.js

    Thanking for response.

  • core_javacore_java Posts: 13Questions: 4Answers: 0

    Both request are same.

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    Answer ✓

    Could you try using the nightly version of Responsive please? That should resolve this issue.

    Allan

  • core_javacore_java Posts: 13Questions: 4Answers: 0

    Thanking you.

This discussion has been closed.