Showing 1 to NaN of NaN entries, server side mode

Showing 1 to NaN of NaN entries, server side mode

marcpiratmarcpirat Posts: 51Questions: 18Answers: 0
edited March 2014 in General
hi

i do a call on the server, i use server side paging.

my init
[code]
$('#tableExample').dataTable({
"bProcessing": true,
"sPaginationType": "full_numbers",
"bLengthChange": false,
"bSort": true,
"bInfo": true,
"iDisplayLength": 10,
"bPaginate": true,
"bAutoWidth": true,
"bServerSide": true,
"sPaginationType": "full_numbers",
"sAjaxSource": 'test.html'
});
[/code]

my result

[code]
{
"sEcho": 1,
"iTotalRecords": 4,
"iTotalDisplayRecords": 4,
"aaData": [
[
"Gecko",
"Firefox 1.0",
"Win 98+ / OSX.2+",
"1.7",
"A"
],
[
"Gecko",
"Firefox 1.5",
"Win 95+ / OSX.2+",
"1.4",
"A"
],
[
"Gecko",
"Firefox 1.6",
"Win 98+ / OSX.2+",
"1.8",
"A"
],
[
"Gecko",
"Firefox 1.7",
"Win 98+ / OSX.2+",
"1.8",
"A"
]
]
}
[/code]

the data is displaybed but i get

Showing 1 to NaN of NaN entries (filtered from 4 total entries) to the left of the table and for the paging: First Previous 1 2 3 4 5 Next Last


thanks

Replies

  • allanallan Posts: 63,299Questions: 1Answers: 10,431 Site admin
    Please link to a test case showing the problem, as required in the forum rules.

    Allan
  • marcpiratmarcpirat Posts: 51Questions: 18Answers: 0
    I'm trying to create one but

    "sAjaxSource": "/examples/server_side/scripts/server_processing.php",

    don't seem to work
  • allanallan Posts: 63,299Questions: 1Answers: 10,431 Site admin
    In what way?

    There are some pre-built Ajax loading examples for live.datatables.net detailed and linked to here: http://next.datatables.net/manual/tech-notes/9#Ajax-loaded-data .

    Allan
  • allanallan Posts: 63,299Questions: 1Answers: 10,431 Site admin
    Is your `'test.html'` file dynamically processed? You are using server-side processing, so it should be... That would be unusual though since .html suggests it is a static file.

    Allan
  • marcpiratmarcpirat Posts: 51Questions: 18Answers: 0
    edited March 2014
    test.html it's only a url used on server side... can change it to test.... change nothing
    anyway i get data


    i commented it in my code and that worked a little bit better, paging bar stopped to display 1, 2, 3 ...
    but i continue to see: Showing 1 to NaN of NaN entries (filtered from 4 total entries)

    i'm using datatable 1.9.4

    so a part of problem seem to be the dataTables.bootstrap.js

    can't log or create a new account on http://live.datatables.net/
  • marcpiratmarcpirat Posts: 51Questions: 18Answers: 0
    ok i used

    and changed

    sEcho by draw:
    iTotalRecords" by recordsTotal
    iDisplayRecords by recordsFiltered
    aaData by data

    and the Showing 1 to NaN of NaN entries problem is resolved

    so i tried with to use: "sPaginationType": "bootstrap",
    but i get

    Cannot call method 'fnInit' of undefined
    jquery.dataTables.js:3163
  • allanallan Posts: 63,299Questions: 1Answers: 10,431 Site admin
    Have you included the Bootstrap integration libraries? See: http://next.datatables.net/manual/styling/bootstrap

    Allan
  • marcpiratmarcpirat Posts: 51Questions: 18Answers: 0
    yes

    can't log on live.datables.net so i post the code here
    [code]
    // Server-side processing with POST
    $(document).ready(function() {
    $('#example').dataTable( {
    "sPaginationType": "bootstrap",
    "bProcessing": true,
    "bLengthChange": true,
    "bSort": true,
    "bInfo": true,
    "iDisplayLength": 10,
    "bPaginate": true,
    "bAutoWidth": true,
    "bServerSide": true,
    "sDom": '<"#thead"f>tipr',
    "ajax": "/ssp/objects.php",
    "aoColumns": [
    { "sTitle": "Firstname", "mData": "first_name" },
    { "sTitle": "Lastname", "mData": "last_name" },
    { "sTitle": "Position", "mData": "position" },
    { "sTitle": "Office", "mData": "office" },
    { "sTitle": "Start date", "mData": "start_date" },
    { "sTitle": "Salary", "mData": "salary" }
    ]
    } );
    } );
    [/code]

    [code]
    <!DOCTYPE html>








    DataTables - JS Bin






    Name
    Position
    Office
    Age
    Start date
    Salary





    Name
    Position
    Office
    Age
    Start date
    Salary






    [/code]

    with this code in http://live.datatables.net/
    i got: Uncaught TypeError: Cannot call method 'fnInit' of undefined
This discussion has been closed.