How to change page number programmatically in a table

So, I'm trying to to open page 38 automatically when opening a resource table. Currently I use the ListRecords class to redirect with a specific page. Unfortunately it's redirecting to a livewire route instead of the intended route. Is there other strategy I can use?
No description
No description
11 Replies
Vp
Vp4mo ago
livewire/update is internal livewire url to update data.. in your case it should be like burb.test/buckets?page=38 not livewire
Bagus A
Bagus AOP4mo ago
@Vp it's filament that redirecting to livewire. the $url contains the actual url. How do I prevent filament to redirecting it to livewire url? I only need basic redirect to open the default page.
Bagus A
Bagus AOP4mo ago
Here's the dd of the $url
No description
Vp
Vp4mo ago
Ok.. not sure but what about redirect($url)
Bagus A
Bagus AOP4mo ago
It's the same, I originally using that code, just trying other method to see if it's work.
Bagus A
Bagus AOP4mo ago
Here's the video for a reference
No description
Bagus A
Bagus AOP4mo ago
The main objective is to jump to a particular page by default.
Vp
Vp4mo ago
Try like this
public function mount(): void
{
$this->authorizeAccess();

$this->loadDefaultActiveTab();

$this->setPage(3); // this is how you change default page
}
public function mount(): void
{
$this->authorizeAccess();

$this->loadDefaultActiveTab();

$this->setPage(3); // this is how you change default page
}
Inside ListRecord
Bagus A
Bagus AOP4mo ago
Here? It doesn't work.
No description
Bagus A
Bagus AOP4mo ago
Oh wait, it's working, just the query parameter is not there. Thank you @Vp
Vp
Vp4mo ago
Yeah not sure about how to show that one anymore.. welcome
Want results from more Discord servers?
Add your server