Server Side Pagination

Server Side Pagination

gharshilgharshil Posts: 1Questions: 0Answers: 0
edited September 2012 in DataTables 1.9
I found Data tables Api a great piece of plugin to use for.but i am going through one problem with the pagination.

I have implemented paging within Stored Procedure which returns the frame of data to be displayed upon click the page number from the Datatable UX.Along with the my dataset.

I assign iTotalRecords=TotalPageCountFrommyDB;
iTotalDisplayRecords=20;(As i want to display 20 records per page)

My data set also returns the Number of pages that is generated from total Number of pages of my resultset.

now everytime I click on the other page.it gives me the RecordCount(21 for page number 2) instead of giving me pageindex.
even clicking on Next ,previous,first ,Last i am not able to get the page index

how to get pageindex ?

Thanks
Harshil

Replies

  • allanallan Posts: 63,395Questions: 1Answers: 10,451 Site admin
    > iTotalDisplayRecords=20;(As i want to display 20 records per page)

    That's not the correct use of iTotalDisplayRecords. See the documentation on this page for how it should work: http://datatables.net/usage/server-side

    Specifically:

    [quote]
    iTotalRecords
    Total records, before filtering (i.e. the total number of records in the database)

    iTotalDisplayRecords
    Total records, after filtering (i.e. the total number of records after filtering has been applied - not just the number of records being returned in this result set)
    [/quote]

    Allan
This discussion has been closed.