Access pagination number of records picklist via javascript

  • 1
  • Question
  • Updated 6 months ago
  • In Progress
Hello folks!

I need to create my own custom pagination within a Skuid page. I was wondering if there were any javascript methods I could tap into to, for example, access or change the number of records picklist (see screenshot).

Another thing that would be useful is to know which page of the pagination the user is on.



Cheers!

Louis
Photo of Louis Skelton

Louis Skelton

  • 4,878 Points 4k badge 2x thumb

Posted 6 months ago

  • 1
Photo of Louis Skelton

Louis Skelton

  • 4,878 Points 4k badge 2x thumb
I figure I can use javascript to trigger a change to the above picklist and then just hide that picklist via css but I was wondering if there was an approach that was a little less hacky...
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Looks as if registered lists have functions that look potentially useful. Haven't tested any of these.



Photo of Louis Skelton

Louis Skelton

  • 4,878 Points 4k badge 2x thumb
Thanks Pat, that's now gotten me quite far.

So I can now create my own next/prev/go-to-page navigation using stuff like:
MyModel.registeredLists[41].nextPage();
What I can't quite work our is how to set the number of records per page. There's this property:
MyModel.registeredLists[41].currentPageSize
which I can set but if I then call render after setting it doesn't apply the update. I'm really looking for the method where currentPageSize can be set.

Another thing - I can access my particular component via the [41] in the above array of registeredLists - is that a safe way of accessing these properties or is there a better way of targeting the desired list?

Cheers!

Louis
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Better way? No idea. You're farther along than my look into the arguments passed into a snippet. I look for properties that have functions provided and go from there. As you know not all functions are documented.