Set the page on a table

  • 2
  • Question
  • Updated 2 years ago
I have a requirement to be able to set the page on a data table. The scenario is this. The user is on a page that has a tabs and one of those tabs displays related records. The user clicks on one of the related records to go to that record from that record we navigate back to the parent record. The request is to bring the user back to the parent record and tab so that the user is in the same page of the data table.
Photo of Jaime

Jaime

  • 1,220 Points 1k badge 2x thumb

Posted 2 years ago

  • 2
Photo of Jaime

Jaime

  • 1,220 Points 1k badge 2x thumb
is there a property on a table where you can set which page the table is on?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
I'm not sure if you can access the table pagination with url parameters, but it might be worth a shot.

In this type of scenario I would typically just open the detail of the related record in a new window/tab instead, so that the user can just hit back or close the tab and the parent window hasn't moved at all.
Photo of Jaime

Jaime

  • 1,220 Points 1k badge 2x thumb
This reply was created from a merged topic originally titled skuid.$C("tableProjectTasks").element.list.currentPage.

I need the ability to set the page of a table dynamically but can't find a way to call skuid.$C("tableProjectTasks").element.list.goToPage(n);.

The use case is this....
User is on a page that has child records(many) with pagination. The user clicks on one of the child records and goes to that record. I have a back button that brings the user back to parent page and the users have asked to bring the user back into the page of the child records from where they originally started.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Try running some javascript on pageload which would:
  1. check for a parameter in the url (which you pass with your 'back' button). 
  2. if the parameter is there, run .goToPage();

var n = skuid.page.params.NameOfMyPaginationParameter;
if (n) {
skuid.$C("tableProjectTasks").element.list.goToPage(n);. 
}