Help with persistent table order after saving

Hi team I have an edit page that redirect back to the table after using:
protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('index');
}
protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('index');
}
The problem is: If a user has changed the sorting, it resets and they have to resort again which can be a pain if they are doing a lot of updates. I also have this on the $table though that doesn't seem to store the order.
return $table
->persistFiltersInSession()
return $table
->persistFiltersInSession()
Any advice would be greatly appreciated. I am sure it is something simple.
Solution:
Sigh.... ignore me. The second I posed this I found the answer.
return $this->previousUrl ?? $this->getResource()::getUrl('index');
return $this->previousUrl ?? $this->getResource()::getUrl('index');
...
Jump to solution
2 Replies
Solution
403gtfo
403gtfo3mo ago
Sigh.... ignore me. The second I posed this I found the answer.
return $this->previousUrl ?? $this->getResource()::getUrl('index');
return $this->previousUrl ?? $this->getResource()::getUrl('index');
403gtfo
403gtfoOP3mo ago
(Though it still looks like order is not saved in session generally ) Would be a nice feature
Want results from more Discord servers?
Add your server