morlandi / django-ajax-datatable

A Django app which provides the integration of a Django project with the jQuery Javascript library DataTables.net
MIT License
208 stars 64 forks source link

filtering multiple values - checkbox like interface #7

Closed evaldaskub closed 3 years ago

evaldaskub commented 3 years ago

Hi, Firstly - great project - extremely helpful !

Though, I wonder if there's a good way on top of the choices and text filters to have a predefined filter for multiple selections within a list of choices given to a user- i.e. as in excel "filter" where user can select multiple values.

f.e. where drop down filter would be:

Query itself would be myQuery(A | B | C)

You present a similar example function with text based input and "OR" operator, though I wonder if there's a good way to integrate such a drop down selection within the table styling, so it's more natural for the user, instead of having a list of these selections somewhere detached from the table.

I'm afraid this may be a missing feature within datatable, though looking at the examples & your codebase it appears that you have spent a good time with this extension - therefore there's a chance that you have already tackled this problem.

In the end, what I am looking foris a similar menu when you click funnel on this example: https://js.devexpress.com/Demos/WidgetsGallery/Demo/DataGrid/Filtering/jQuery/Light/

Thanks for any suggestions

morlandi commented 3 years ago

Thank you @e-crede for suggestions.

A list of checkboxes would be certainly better UX for multiple selections, at least if you have a short list of choices. The current implementation for the single selection injects the required <select> widget in the headers via javascript (see _setup_column_filters() in utils.js); so it's a fully custom, and does not depend on any support from datatables.js itself ... so: YES ! in principle that could be done.

Not sure when I'll have the time to work on this.

Nice widgets in the link you shared! However, for dates filtering, a "date range" widget would probably be more appropriate for table navigation

evaldaskub commented 3 years ago

thanks for the pointer - I'll have a look at _setup_column_filters() ... I will need this function down the line at some point, so maybe I'll have a chance to integrate it in a nice way in your code & share it... though horizon looks to be ~6months

morlandi commented 3 years ago

Great ... I too might work on this as a consequence of a "real project" need, sooner or later. Let's keep in touch, in case

I temporarily close the issue. Feel free to reopen it at any time

michaeldacanay commented 1 year ago

Hi, was this functionality implemented?