how do i access a table component in javascript

  • 1
  • Question
  • Updated 2 years ago
  • Acknowledged
i need to remember the "page" being dispalyed in a table so that after a row action "save" i can return to that page of records, rather than the default action, which is to return to the first page
what is the syntax for accessing the table in javascript... i'm assuming the "page" being displayed is one of its properties
Photo of ktyler

ktyler

  • 9,244 Points 5k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Emily Davis

Emily Davis, Employee

  • 3,502 Points 3k badge 2x thumb
Ken,
We have acknowledged this as an issue in the Table component that could be improved.

This post gives a little more about how to access the table's pagination (access the current page displayed, and navigate to a different page) via JS. You could potentially run an action on model save that runs some JS to navigate back to the current page. However, you would need to grab the current page the user is on before the model is saved, and perhaps store it in a variable.

Also, you might need to consider a few special situations, e.g. What to do if the page the user was last on no longer exists (e.g. some rows were deleted)?

Hope that helps,
Emily