You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering what the best way is in v8 to automatically navigate to the correct page when adding a new row.
In my case, I have a modal that adds a new entity, which is passed as data to the table and becomes a new row. Currently I'm using controlled pagination and simply updating the state to the index of the last page after creating a new entity (by using myData.length and pagination.pageSize). But this is a naive approach as I can't know for sure that the new entity will be at the end of my data array. It also breaks with column sorting, so I have to control the sorting state as well and reset it after adding a row.
I can't figure out a way of getting the new row's position after it goes through the table's feature pipeline. Any ideas?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I was wondering what the best way is in v8 to automatically navigate to the correct page when adding a new row.
In my case, I have a modal that adds a new entity, which is passed as data to the table and becomes a new row. Currently I'm using controlled pagination and simply updating the state to the index of the last page after creating a new entity (by using
myData.length
andpagination.pageSize
). But this is a naive approach as I can't know for sure that the new entity will be at the end of my data array. It also breaks with column sorting, so I have to control the sorting state as well and reset it after adding a row.I can't figure out a way of getting the new row's position after it goes through the table's feature pipeline. Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions