Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Listgrid Filter for date columns not updating filter

    Dear all,

    in a listgrid with a columnwise filter, I'm experiencing an issue.

    First of all, I would like to only have the filter applied explicitly when clicking the filter icon to the right. I do not find the right combination of settings to accomplish this. Instead, the filter is applied when the filter cell of a column is left.

    The other thing is, that the filter is most of the times applied locally, even though I turned that off.

    The most problematic issue is that if I have a date column and enter a filter in the specific dialog, e.g. "after 2 months ago", the filter is NOT applied. The filter is also not applied, when clicking the filter button (the little button to the left, with the funnel icon).

    That filter is only taken into account, when modifying another filter or when clicking a column header for sorting.

    These are my settings on the listgrid.

    Code:
            listGrid.setShowFilterEditor(true);
            listGrid.setAllowFilterExpressions(true);
            listGrid.setAutoFetchData(false);
            listGrid.setFilterLocalData(false);
            listGrid.setSaveLocally(false);
    Any idea what might be wrong?

    I'm using SmartGwt v13.0p_2024-05-04 from

    #2
    First, you probably want useLocalFiltering:false, not filterLocalData:false. filterLocalData applies to a specific use case where you supply data via setData(), and you want to keep working with that data and never fetch against the DataSource. Presumably, that's not what you're doing (it's a rare usage).

    As far as the rest of the problem, we can't make much sense of what you want. Specifically we don't understand your phrase "when the filter cell of a column is left", and you seem to be describing the corner filter button (with the funnel icon) as "to the left", whereas it's normally on the right side of the grid (unless you are using RTL?).

    Big picture, when you use date-base filtering based on MiniDateRangeItem, when you exit the dialog, filtering will be applied right away, regardless of whether it's absolute or relative date filtering. There is no way to wait for the user to press the filter button, as this would be a bad UE (there is an unapplied filter and there is no indication for the user that this is the case).

    Comment


      #3
      "you seem to be describing the corner filter button (with the funnel icon) as "to the left", whereas it's normally on the right side of the grid (unless you are using RTL?)."
      Yes, you are right, I misdescribed: The button is to the right. Still, I was referring to that button.


      "when the filter cell of a column is left"

      I meant exactly that: The filter is applied when the filter cell is left, i.e. "exited".

      "filtering based on MiniDateRangeItem, when you exit the dialog, filtering will be applied right away"
      And that this is not done in my use case is exactly the problem. Maybe this has to with using filterLocalData instead of useLocalFiltering so I will test this.

      "Big picture, when you use date-base filtering based on MiniDateRangeItem, when you exit the dialog, filtering will be applied right away, regardless of whether it's absolute or relative date filtering. There is no way to wait for the user to press the filter button, as this would be a bad UE (there is an unapplied filter and there is no indication for the user that this is the case)."
      So, there is no way of deferring the filter? The use case is that we have a huge amount of data and the user would want to first setup the filter to shrink the amount of records to an acceptable (and workable to the user) amount of data and then have the filter request sent to the server.

      I agree to your remark about bad user experience as there is really no "filter dirty" indicator, but maybe there is another property to read, so I could visualize that myself.

      Regarding "useLocalFiltering", thanks for the hint, that is something I will test out.

      Comment


        #4
        For the situation where you don't want to fetch at all until filtering is set up, the typical UE is to create a SearchForm that the user has to fill in before the first fetch occurs at all. This is trivial to achieve by just binding a SearchForm to the same DataSource the grid is using.

        Once you've corrected your settings, please let us know if you're still experiencing an issue with filter timing. It will have to be a standalone test case, as we can already see that the filter timing is as expected in various samples and automated tests.

        Comment


          #5
          listgrid does not seem to have a method setUseLocalFiltering. At least this is how I interpret your statement of using useLocalFiltering:false.

          Do I need to do it differently?

          Comment


            #6
            Sorry, our mistake - the API is actually useClientFiltering:

            https://smartclient.com/smartgwtee-l....lang.Boolean-

            Comment

            Working...
            X