How to link to the table with filters in the URL so that they get applied on load? #1315
Unanswered
manuelteuber
asked this question in
Q&A
Replies: 1 comment
-
You can do as follows final class StudentList extends PowerGridComponent
{
use WithExport;
use ActionButton;
public int $perPage = 50;
public array $perPageValues = [50,100];
public string $primaryKey = 'students.id';
public string $sortField = 'students.id';
public string $grade;// the values pass from the view
public function datasource(): Builder
{
return Student::query()
->where('grade','=',$this->grade);
}
} And on the view <livewire:student-list grade="2"/> I hope you can tweak it to achieve with the URL |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a powergrid table with a lot of filters. From my dashboard I want to link to the page where the powergrid table is placed and include the filters in the URL, so that they get populated and the data filtered when the table is loaded.
App\Livewire\BookingsTable.php
When using the filters of the table, the URL changes to include the filters in the query string. But when I copy this URL and open it again, the filters are not applied.
How do I make this work?
Beta Was this translation helpful? Give feedback.
All reactions