Replies: 2 comments
-
same problem here, how do you solve it? i need the filter options based on query. Something like this: #941 Greetings! |
Beta Was this translation helpful? Give feedback.
0 replies
-
So for my filter for example I am using the Query builder so we can use: ->filter(function(Builder $builder, string $value) {
if ($value >= '1') {
$builder->where('pdf_generated', true);
} elseif ($value <= '0') {
$builder->where('pdf_generated', false);
}
}) In theory, you can further refine that, by getting the current set filters to add more wheres with: $this->getAppliedFilterWithValue('my_column') It will return null if empty. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I would like to ask, if there is any option to access query (outside of query() function) that is shown in table, without using $this->query() function?
I have tried to have another private attribute for query, that sets up at the end of query() function, but somehow it always ended up null, and I don't know why (my guess is, that it defaults to null after livewire update event somehow).
Also reason I need to access query is to use it for customized filter options based on query, and export currently filtered rows to i.e. CSV (and to use custom styled button for export, as I don't really like default, but don't know if you can customize it's styling...).
I don't know if it was somewhere mentioned, I don't really know what to search for to get an answer and already tried to search it anywhere, even couldn't find this in documentation, so that's why I am asking here...
I am using rappasoft/laravel-livewire-tables version 1.16.
Also sorry if it sounds trivial, but I have not really deep dived into package's code as I am not that skilled to do that and understand something 😄.
Beta Was this translation helpful? Give feedback.
All reactions