Prepopulate constraints
When using constraints in a table filter like here: https://filamentphp.com/docs/3.x/tables/filters/query-builder is it possible to pre-populate the filters?
I looked at doing it via query string, but because the constraints are dynamic it doesn't look like it'll work
I have a table full of data and I'd like to "guess" which record the user wants to see by some filtering across multiple fields. I'm avoiding modifying the query of the table so that users have access to all the records.
Thanks
3 Replies
Querystring should work, basically filter the table with the filters and you'll see the queryStirng in use. Just pass that in, it takes precendence over sessions filters
I did try the QS method, but parts of it are dynamic for example - in the below
ZC21
is dynamic and changes each time
http://localhost/my-page?tableFilters[queryBuilder][rules][ZC21][type]=from&tableFilters[queryBuilder][rules][ZC21][data][operator]=contains&tableFilters[queryBuilder][rules][ZC21][data][settings][text]=adamSo just change it in the url builder?
I would need to see where it is dynamically changing