Code Monkey home page Code Monkey logo

Comments (2)

ThePumpingLemma avatar ThePumpingLemma commented on May 26, 2024

This feature looks like a pain to implement. For example, let's say the UI does respect previous filters by reading the possible values from the table instead of the model. If I initially open the filter popup and see:

[x] All
[x] Item1
[x] Item2
[x] Item3

If I select "Item2" and apply it, subsequent views of the filter will show:

[x] All
[x] Item2

Since the filter popup would only show values that actually appear in the filtered table, there is no way to reselect "Item1" or "Item3" unless all of the filters are reset. This is especially bad if you want to retain a number of filters that you already have applied to other columns.

In order for this to work, you would need a view of the table that does not contain any filters for the current column you wish to display the filter popup for. Easiest way would be to allow the popup to access all of the previous applied filters, take the subset of filters that are not applied to the popup's column, and manually filter the table with the filter subset (as opposed to using JTable's getValueAt() method). At a minimum, the JTableFilter will have to be reworked since the filters are currently composed in a recursive manner (i.e. the only way to remove a filter is to clear them all). The bigger problem is that the actual filtering mechanism is implementation dependent and doesn't necessarily map well between implementations (e.g. the JTableFilter composes RowFilters whereas a GlazedLists-based table would use FilterLists), so it may be difficult to map it back to a simple API to use within filtering GUI.

Additionally, the distinct item caching mechanism would need to be reworked or removed since the cache would need to be reset every time a filter is applied or unapplied. Personally, I have a feeling that the caching cannot be reworked since their isn't a full-proof way to listen to the table for filtering changes (e.g. listening for JTable filtering changes vs. JXTable filtering changes vs. GlazedLists filtering changes).

I think it is technically feasible, but I think a good chunk of the code needs to be redesigned to accommodate this request.

from oxbow.

muelli1000 avatar muelli1000 commented on May 26, 2024

Has this issue been resolved yet? I am looking for a smart solution.

from oxbow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.