2016-04-20 2 views
0

У меня есть datatable, который состоит из 200+ записей и более 10 страниц. Pagination работает отлично при нажатии на следующую и предыдущие кнопки. Но я получаю и выдаю, когда нажимаю конкретную страницу и пытаюсь перейти на другую страницу (например: клики на 1 странице, а затем на 5-ю страницу). Он показывает сообщение обработки, и ничего не происходит.JQuery bootstrap datatable pagination issue

Я получаю эту ошибку на консоли:

enter image description here

var oTable = $('#trip_infor_tbl').dataTable({ 
      "bProcessing": true, 
      "bServerSide": true, 
      "sAjaxSource":"trip/infor", 
      "paging": true, 
      "language": { 
       "emptyTable":  "No rejected entries available in table", 
       "info":    "Showing _START_ to _END_ of _TOTAL_ entries", 
       "infoEmpty":  "Showing 0 to 0 of 0 entries", 
       "infoFiltered":  "", 
       "infoPostFix":  "", 
       "lengthMenu":  "Show _MENU_ entries", 
       "loadingRecords": "Loading...", 
       "processing":  "Processing...", 
       "search":   "Search:", 
       "zeroRecords":  "Select a batch number from the above list", 
       "paginate": { 
        "first":  "First", 
        "previous":  "Previous", 
        "next":   "Next", 
        "last":   "Last" 
       }, 
       "aria": { 
        "sortAscending": ": activate to sort column ascending", 
        "sortDescending": ": activate to sort column descending" 
       }, 
       "decimal":   "", 
       "thousands":  "," 
      }, 
      "fnServerData": function (sSource, aoData, fnCallback, oSettings) { 
       oSettings.jqXHR = $.ajax({ 
        "dataType": 'json', 
        "type": "GET", 
        "url": sSource, 
        "data": aoData, 
        "success": fnCallback, 
        "error": function (e) { 

        } 
       }); 

       if(oSettings._iDisplayLength != -1) { 
        page_no = Math.ceil(oSettings._iDisplayStart/oSettings._iDisplayLength); 
        selectall.push(new Array()); 
       } 
      }, 
      "fnRowCallback": function(nRow, aData, iDisplayIndex , iDisplayIndexFull) { 
       //console.log(aData[0]); 

       selectall[page_no].push(aData[0]); 
       //console.log(page_no); 
       //console.log(selectall[page_no]); 
       $('#trip_infor_tbl tbody tr').each(function() { 
        if (jQuery.inArray(aData[0], aselected)!=-1) { 
         $(this).addClass('selected DTTT_selected '); 
        } 
       }); 
       return nRow; 
      }, 
      "fnDrawCallback": function (oSettings) { 
       if(oSettings._iRecordsTotal == 0) { 

        $("#trip_infor_tbl").find("td").remove(); 
        $("#trip_infor_tbl tbody").append('<th class="odd"><td valign="top" colspan="8" class="dataTables_empty">No data available in table</td></th>'); 

       } 
       if(oSettings._iDisplayLength != -1) { 
        page = Math.ceil(oSettings._iDisplayStart/oSettings._iDisplayLength); 
       } 
       selected_id.push(new Array()); 

       $('#addbtn').attr('disabled','disabled'); //hide add to approve button on load 

       if (oSettings._iRecordsDisplay == 0) { 
        $('#addbtn').attr('disabled','disabled'); 
       }else{ 

       } 
................................................. 
+0

Что находится в строке 65 s.js? – AceWebDesign

ответ

0

Try без линии "bProcessing": правда или/и "bServerSide": истинный Ваш стол не очень большой, так вы не должны заметить потери производительности