Method to add new row to a particular page

Method to add new row to a particular page

sunmit9sunmit9 Posts: 19Questions: 1Answers: 0
edited February 2017 in Free community support

Is there any way by which we can add a new row to a particular page? I am using the bootstrap uid-pagination for my custom pagination which fetches records from backend. If i click on page 4, it returns me records with index 40 to 49, which is expected and runs fine. The only problem is, when I say table.page( 3 ).draw( 'page' );, the datatable does not show any records on that page. (This must be because the datatable has not yet build the page 3. After table.rows.add(), the total number of pages was just 2 with total 20 records).

Is there a way so that i can tell the datatable to directly add these records on page 4?

Answers

  • allanallan Posts: 61,692Questions: 1Answers: 10,102 Site admin

    Where a row is added into a DataTables is determined only by the ordering of the data in the table and the data in the newly added row.

    Allan

  • sunmit9sunmit9 Posts: 19Questions: 1Answers: 0

    So how does the server side pagination using AJAX call works? How does it make sure that the data is to be populated at the given page number?

  • allanallan Posts: 61,692Questions: 1Answers: 10,102 Site admin

    So how does the server side pagination using AJAX call works?

    I'm not sure how that relates to the original question, but this document describes how server-side processing works. It also defines the parameters sent to the server so the server can know what data to return for the required page.

    Allan

This discussion has been closed.