Manually set total records

Manually set total records

mmoreno79mmoreno79 Posts: 2Questions: 1Answers: 0

I am using the api to manually add rows to my datatable. I'm making use of angularjs and web api to retrieve a set of records to display (paging is handled in the back-end).

Is there a way to set the total number of records so that the paging controls would render properly?

I see I can use serverSide and ajax but my current implementation won't allow me to do that.

Answers

  • sciszewski@salesapex.comsciszewski@salesapex.com Posts: 10Questions: 0Answers: 0

    Do you mean when you add x records you want the paging controls to update to reflect a new page being available (as an example)?

  • mmoreno79mmoreno79 Posts: 2Questions: 1Answers: 0

    Since I'm using server-side paging, I retrieve only a page of records for each request. I also return the total number of records available. I'd like to manually set total records available so the paging controls properly display the number of pages.

    For example, the initial request for my page brings back 20 records. At the same time, there are a total of 100 records. When my request comes back from my web api request, I am displaying the 20 records returned, but I also want the paging controls to display pages 1, 2, 3, 4, and 5. Right now it only displays the pages for the records I add to the datatable.

  • ignignoktignignokt Posts: 146Questions: 4Answers: 39

    If you have 100 records but only show 20 per page, then just from the server-side portion you should already have 5 pages before you add additional rows. Is this not the case for you? Or do you already have 5 pages of 20, and when you add additional data page 6 does not appear?

This discussion has been closed.