Beginner error: Pagination and searching not working

Beginner error: Pagination and searching not working

crich04crich04 Posts: 20Questions: 6Answers: 0

I am new to datatables and have acquired some javascript from a third party to implement this. I hope this should be really easy. I have a serverside static JSON data file supplying the data for a table. The data shows up but, all the records show with no pagination, searching or filtering. I followed the example online and use the same data. Only difference is styling from what I know.

Here it is: http://www.source360.com/datatables/test.html

This question has an accepted answers - jump to answer

Answers

  • crich04crich04 Posts: 20Questions: 6Answers: 0

    In fact, here is the example implemented on the website. Same problem.

    http://www.source360.com/datatables/original.html

  • kthorngrenkthorngren Posts: 20,302Questions: 26Answers: 4,769

    I think the problem is with the static file. I believe everything is correct in what your returning except the number of rows. In the server side request there are parameters for start and length. Datatables is expecting the first record and the number of records returned to correspond to those parameters.

    Kevin

  • crich04crich04 Posts: 20Questions: 6Answers: 0

    Ok, I took off serverSide and processing and it works as expected. I guess it's passing more info to server side and it's dumb.

  • kthorngrenkthorngren Posts: 20,302Questions: 26Answers: 4,769
    Answer ✓

    Have a look here for serverside info:
    https://datatables.net/manual/server-side

    Kevin

This discussion has been closed.