Nan sInfo _TOTAL_datatable jquery/JSON

Asked

Viewed 125 times

0

I have a problem in return of JSON in variable TOTAL that returns Nan is strange pq before the problem was in the variable END I removed and added END again and back to normal but, began Nan in the variable TOTAL. Someone can help us?

$(document).ready(function() {
   oTable = $("#grid").dataTable({
      "bProcessing": true,
      "bServerSide": true,         
      "bPaginate": true,
      "iDisplayLength": 25,
      "sPaginationType": "full_numbers", 
      "sAjaxSource": urlAjaxSource,
      "oLanguage": {
          "sSearch": "Procurar:",
      "sLengthMenu": "Exibir _MENU_ itens por página",
      "sZeroRecords": "Nenhum registro encontrado.",
      "sInfo": "Exibindo _START_ a _END_ de _TOTAL_ itens"//onde acontece o erro _TOTAL_
    }
    });
});

1 answer

1

Your Json needs to return this structure below for dataTables to assume the correct totals:

{
  "draw": 1,
  "recordsTotal": 57,
  "recordsFiltered": 57,
  "data": [
    { [...]

If you still don’t solve post a piece of your json so we can evaluate it better.

  • Check whether the return variables are being filled and or how they are being filled: {"iTotalRecords": "iTotalDisplayRecords" }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.