Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable: Numeric filters with option to select a comparator (=, !=, <, >, <=, >=) #7427

Closed
Tracked by #11251
tuerker opened this issue Jun 15, 2021 · 15 comments
Closed
Tracked by #11251
Labels
new feature sponsoring required This issue requires financial sponsoring through PrimeTek PRO support

Comments

@tuerker
Copy link
Contributor

tuerker commented Jun 15, 2021

It would be really great if out-of-box numeric datatable filters would be supported such that you can enter a filter value together with the dynamic option to select a comparator (=, !=, <, >, <=, >=). This would massively enhance the usefulness of the table filters.

@melloware
Copy link
Member

I think you are looking for something similar to how PrimeVue does it. See the example here: https://primefaces.org/primevue/showcase/#/datatable/filter and click on the "Balance" column filter icon.

@tuerker
Copy link
Contributor Author

tuerker commented Jun 15, 2021

yes, functionality-wise it is exactly that.

i would just prefer a different DEFAULT layout where you have the input field followed on the right end by a SelectOneMenu for the comparator selection. this would have the advantage that you can easily overview your entire filter criteria.

@tuerker
Copy link
Contributor Author

tuerker commented Jun 15, 2021

actually, this is nearly the second variant, the Filter Row approach, of primevue. would be great if this could be available for primefaces, too. the primevue extension looks really very powerful and generic. props to the developers.

@melloware
Copy link
Member

Up to PrimeTek or Sponsored by a PRO account. I doubt any of the open source volunteers will commit to this.

@buunsal buunsal removed their assignment Oct 31, 2021
@eduarddrenth
Copy link
Contributor

For my pf (jpa) apps I use a library that allows users to use some syntax in values.

Based on https://bitbucket.org/fryske-akademy/crudapi/src/master/jpaservices/src/main/java/org/fryske_akademy/jpa/OPERATOR.java

see https://bitbucket.org/fryske-akademy/crudapi/src/master/

Perhaps this is of use

@jepsar
Copy link
Member

jepsar commented Jan 18, 2022

We could create a default filterFunction in PFE or PF to support this. That would be easier than adding it to the filter feature.

@jepsar
Copy link
Member

jepsar commented Jan 18, 2022

.. I must say, that Vue filter demo is awesome

@eduarddrenth
Copy link
Contributor

I'll have a look, perhaps I'll even refactor to stick closer to PF, or develop an extension sometime

@melloware
Copy link
Member

Yep PrimeTek has updated the 3 JS libraries Datatable for that Advanced filtering its pretty slick.

@eduarddrenth
Copy link
Contributor

I assume these filtering features aren't passed on into the jpa data layer and executed there?

@eduarddrenth
Copy link
Contributor

I have the feeling I did not explain clear enough what my solution offers, it has been very valuable for years now for us.

jpa module

  • building jpql queries, supports all possible jpql comparisons
  • supports syntax in parameter values (i.e. !>=10, 1 <=> 5, is null, is blank, is empty, > "ape", 'Star*')
  • supports boolean logic and (nested) grouping

primefaces module

  • an abstract controler and LazyModel responsible for pagination and converting sort and filter data to what the jpa module requires

I maintain ee8 and ee9.1 versions.

This gives users powerfull filter and sorting possibilities and pagination, all the way into the datalayer, either or not supported by a gui component (did not build that)

I can imagine some refactoring may be required before (some of) this finds it's way into primefaces, especially since now primefaces has a jplazydatamodel.

@jepsar
Copy link
Member

jepsar commented May 19, 2022

I don't think that parsing the filter value is the best option here. I think that somehow the filterMatchMode should be selectable from a list of allowed options.

@eduarddrenth
Copy link
Contributor

Ok of course, though I experience a bit of syntax that enables advanced sql like querying makes (some) users very happy.

@melloware
Copy link
Member

Agreed all around if we can make an advanced Filtering option like PrimeVue/React where it basically sets the filterMatchMode etc it should just flow down in to JpaLazyDataModel or MorphiaLazyDataModel etc and just work if done correctly.

@melloware melloware added the sponsoring required This issue requires financial sponsoring through PrimeTek PRO support label Jan 13, 2023
@melloware
Copy link
Member

Replaced by #11251

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature sponsoring required This issue requires financial sponsoring through PrimeTek PRO support
Projects
None yet
Development

No branches or pull requests

5 participants