[Feature Request] Add filtersView() to v2/v3 #1496
Replies: 20 comments 19 replies
-
I'll certainly look at it, what were you trying to achieve out of interest as there may be a workaround. There is an option for a Custom Label Blade and Custom Pills Blade. I just hadn't thought about the filter blade itself. |
Beta Was this translation helpful? Give feedback.
-
Thank you ! Right now we are trying to upgrading the package from v1 to v2. For some filters we created our own blade template where we render the UI for specific filters. It was great because you just need to point to a specific path as it is described in the v1 doc. Little feature but it is really flexible at least for our use case. |
Beta Was this translation helpful? Give feedback.
-
No promises on timescales, but I will take a look at some options. In the meantime, you could publish the views for the filters, and customise the blades there. In theory, you could pass a config() option to the filter, and then use that config setting to determine how to render the blade. That'd work for the meantime at least! I have stuck a few additional filter options in a separate package (for now at least) which may interest you if you're migrating to V2. LaravelLivewireTablesAdvancedFilters. I mainly use Tailwind, so that implementation is cleaner than the Bootstrap look/feel, but is a work in progress, one of the next releases for that add-on package is Component Filters, so I should be able to port some of the code for customising filter blades back across easily enough. |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
This will probably be a v3 feature, unless I have a burst of inspiration in the next couple of weeks. V3 will be an interim version introducing some new Livewire 3 dependent features. Then v4 will be a major rework. |
Beta Was this translation helpful? Give feedback.
-
I've added this to the v3 project board, as we're going through any last additions for the initial release this week. It may not make it in for v3 initially, but it's in the project and will be addressed! |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
Removing wontfix label. This is in dev pipeline for v3 My current plan for filters is the following:
|
Beta Was this translation helpful? Give feedback.
-
This topic is of great interest to me as well. Our use case for a custom filter view, beyond just wanting more control over layout, is that we want to scope some filter options based on the value of others. For example, we have a "Metal" filter. Based on the selected value, we'd want to scope the queries we use to build options for the other filters to just get models associated with the selected My hope is that we can accomplish this by using a Livewire component as our filters view, and having it pass the |
Beta Was this translation helpful? Give feedback.
-
Independent and LW Component filters are definitely in the pipeline, particularly for v3. So it'll be possible to natively link filters. Happy to explain how to build an independent filter on Discord in the meantime though. There are a few mandatory methods for it to work with the package, but the rest is open. I previously published an addon package containing additional filters for this package, it is very straightforward to achieve if you have specific needs! A large chunk of v2 to v3 was cleaning up the views, code, and improving performance as it'll be easier to customise going forward. |
Beta Was this translation helpful? Give feedback.
-
I have a working example for your ask for v3 using two select filters (one of which does nothing to the query i.e metal, then the other updates options from that) Caveat is, I haven't yet added grouping etc, so it'd visually appear to be two distinct filters at the moment |
Beta Was this translation helpful? Give feedback.
-
This is awesome, thank you! When do you anticipate the v3 docs will start rolling out? |
Beta Was this translation helpful? Give feedback.
-
This particular example isn't in the repos yet as it does need one tweak to the rendering approach, but you can see some of the new docs by browsing the "docs" folder in the v3-develop branch. I'm hopeful for maybe back end of next week to have a proper beta release which will also add this function, and add the docs to the main website for easier reading. Sent from Outlook for Android |
Beta Was this translation helpful? Give feedback.
-
This one is still in progress for v3, along with use of a Livewire Component Filter. Definitely days/weeks rather than any longer Just tied up with bugs etc |
Beta Was this translation helpful? Give feedback.
-
Edited to display as feature request. This is very much on roadmaps. V3 has several filter improvements inbound, including this. |
Beta Was this translation helpful? Give feedback.
-
Hi, wanted to see if you could share the examples if they aren't already committed somewhere. |
Beta Was this translation helpful? Give feedback.
-
@nathan-io - I'll add a doc detailing this over the weekend. |
Beta Was this translation helpful? Give feedback.
-
Glad to see a stable release! Thanks for your hard work on this. I checked the filter docs but they don't seem to mention this yet. |
Beta Was this translation helpful? Give feedback.
-
Awesome, thank you! I see the relevant docs. Our likely use case would be to include a Livewire component in the custom view. That component would handle updating the options based on the other active filters and their values. If you're able to share the working example of two filters where one affects the options for the other, that would be really helpful in understanding how to use this. As for the view, are there any certain requirements as to how options/data are handled? I think the changelog mentioned a DTO for filter data. |
Beta Was this translation helpful? Give feedback.
-
Looking at the setCustomView() doc/example again, I realize that I was misunderstanding the purpose of this method. It isn't used to define a custom view where all of your filters live, but rather, the view for a specific filter. 🤦 Still, the requirements within the custom view remain unclear to me. Presumably, in our view we'd need the values for attributes like When talking about filter customization, it seems to boil down to two areas:
One approach which seems like it would solve for all of this is to let us define a custom Livewire component which is responsible for rendering all filters and dynamically updating their options as a user makes selections. (To clarify, I mean that in the view for this LW component, we would have all of our filters together. This could be a mix of Blade components, other LW components, and regular Blade markup.) Each time the user makes or changes a filter selection, the component would trigger livewire-tables to re-query based on the updated filtered scope and refresh the DOM. Hope this makes sense. |
Beta Was this translation helpful? Give feedback.
-
First of all thank you for your hard work and this package is great. Im missing a useful feature: https://rappasoft.com/docs/laravel-livewire-tables/v1/filters/custom-filter-view
Can we get this in v2 or is there are workaround ?
Beta Was this translation helpful? Give feedback.
All reactions