After clicking 'Apply columns' it is not redirected to list page. How can i redirect it ?

No description
Solution:
I don't know if we have a better way to do that, but for now you could try some JS code to force close the panel Add this to your ListPage ```php...
Jump to solution
7 Replies
LeandroFerreira
I think it should refresh the table columns, not redirect. What you mean?
hlonish
hlonishOP5w ago
I mean after column applied sucessfully, if it will redirect to list page then it will be good rather than still opening that column manager @Leandro Ferreira any solution for that ?
LeandroFerreira
why should it redirect to the same page you are already on?
hlonish
hlonishOP5w ago
@Leandro Ferreira I mean close column manager modal after it applied sucessfully
Solution
LeandroFerreira
I don't know if we have a better way to do that, but for now you could try some JS code to force close the panel Add this to your ListPage
public function applyTableColumnManager(?array $state = null): void
{
parent::applyTableColumnManager($state);

if ($state) {
$this->js(<<<'JS'
document.dispatchEvent(
new KeyboardEvent('keydown', { key: 'Escape' })
)
JS);
}
}
public function applyTableColumnManager(?array $state = null): void
{
parent::applyTableColumnManager($state);

if ($state) {
$this->js(<<<'JS'
document.dispatchEvent(
new KeyboardEvent('keydown', { key: 'Escape' })
)
JS);
}
}
LeandroFerreira
@hlonish did it work?
hlonish
hlonishOP4w ago
@Leandro Ferreira yes ! It works as expected. Thank you so much

Did you find this page helpful?