Announcement

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

    Best practice question: FilterBuilder built criteria and their display in filterRow

    Hi Isomorphic,

    reading this question I have a question of my own (not urgent).
    At some point I'll develop a feature like the one mentioned in the thread: Configure and save criteria, later re-apply one of those criteria from a list of saved criteria.
    Right now I have a ListGrid with optional filterRow, which stores the current criteria in the DB, so that those criteria are re-applied after logoff/logon.

    The new criteria will be edited in a GUI much like yours here, plus a name field for the selected criteria and a save button etc.

    Those criteria will be more advanced - like the pre-existing criteria in the sample. In the sample you are not showing showFilterEditor: true - for a good reason - the filterRow can't possibly display AND/OR Criteria.

    What is your GUI suggestion here, if I want to show the filterRow as much as possible? Is there some ListGrid(?) method that shows me that the criteria for at least one field cannot be properly displayed in the filterRow and therefore I should hide it? I assume this has something to do with FormItemCriterionSetter.
    Just an inner AND/OR criterion is not enough - for example one could define two criteria for a field on the top-level, making it effectively an AND-criterion, which the filterRow then can't display for that field.

    Thank you & Best regards
    Blama

    #2
    There's not currently a single framework method that can tell you whether a given AdvancedCriteria can be fully edited within the FilterEditor, however, DataSource.canFlattenCriteria() can tell you whether nested operators definitely make it impossible, and you could then write a quick method to check whether operators are present that the FilterEditor can't show.

    As far as best practices, if you want to keep the FilterEditor visible while also allowing criteria to be added via a FilterBuilder, we would recommend having any FilterBuilder criteria be cumulative with the FilterEditor via implicitCriteria or via the FilterEditorSubmit event (which is an opportunity to inject additional criteria).

    Comment


      #3
      Hi Isomorphic,

      thanks for the hint on DataSource.canFlattenCriteria(). I knew I read something like that before. With it and some criteria counting in pretty sure I can decide if criteria can be displayed in the filterRow.
      Also, I'll most likely not show the filterRow, if it includes criteria for hidden fields.

      I'll let you know how it went once I come to do this task.

      Thank you & Best regards
      Blama

      Comment

      Working...
      X