Announcement

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

    ListGrid FilterEditorCriteria Advice

    Smart GWT Power 2.5 Release

    I am looking for some advice on handling the following scenario with a ListGrid component:

    There are multiple text columns in the grid and the ability to search most of those fields via a substring comparison is correct. However, I have two columns where that substring fails to match what they are looking for (e.g. Complete, Incomplete). Entering "Complete" will identify both "Complete" and "Incomplete".

    My first plan of attack was to use the ListGrid.addFilterEditorSubmitHandler() method and update the underlying Criteria with a more precise AdvancedCriteria definition.

    However, I do not seem to be able to override the ListGrid criteria in the event handler using the methods: ListGrid.setCriteria() or ListGrid.setFilterEditorCriteria()

    What is the proper approach to override a filter editor criteria once the user has initiated the query request via the filter editor submit button?

    Thanks.

    #2
    You can use FormItem.setOperator() via ListGridField.setFilterEditorType() to tell those fields to generate exact match criteria. Then you don't need to add a filterEditorSubmitHandler at all.

    Comment


      #3
      Your suggestion worked great - thank you!

      For anyone reading this post - I simply defined ListGridFields for my ListGrid and assigned the two special cases as follows:

      Code:
      ListGridField lgfRecordStatus = new ListGridField("RECORD_STATUS", "Record Status", 85);
      lgfRecordStatus.setFilterOperator(OperatorId.EQUALS);
      ListGridField lgfDiseaseStatus = new ListGridField("DISEASE_STATUS", "Disease Status", 85);
      lgfDiseaseStatus.setFilterOperator(OperatorId.EQUALS);

      Comment

      Working...
      X