Announcement

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

    Suggestion how to Override Column Filter Criteria of List Grid

    SmartClient Version: v10.0p_2015-11-20/PowerEdition Deployment (built 2015-11-20)

    I have a List Grid where I have enabled the Filter Editor - setShowFilterEditor(true). One of the List Grid Fields has setEditorProperties( ComboBoxItem). This ComboBoxItme instance is setting the setPickListCriteria( AdvancedCriteria). All works fine within the Grid. When I select the Combo Box within the Grid I get the correct pick list criteria and dropdown choices.

    Issue is when I attempt to use the Filter on top of the List Grid for that column. The drop down list is not applying any criteria that matches a cell within the Grid, It is an unconstrained list of elements, i.e. no criteria is set in the dropdown.

    How should I set the filter criteria for this Column so that it's drop down list has the correct criteria in the fetch? This column seems to be ignoring the fetchData() criteria set for the List Grid, is this because the Datasource of the ComboBoxItem is different than the DS of the List Grid itself?

    T

    #2
    If you apply pickListCriteria via editorProperties, that doesn't apply to the filterEditor - use filterEditorProperties for that.

    A ComboBoxItem used in the FilterEditor will not try to automatically use criteria on the grid, even if the grid is using the same DataSource. This is because only being able to see the data currently in the grid is not always better.

    However, you can set up a comboBox in the filterEditor in this way if you like, via installing a PickListFilterCriteriaFunction that looks at the grid's criteria and returns it. Just be aware there are a special cases, for example, you need to ignore criteria values for the ComboBoxItem's field itself, or the only matching value you'll see in the pickList is the currently applied criteria value.

    Comment


      #3
      Originally posted by Isomorphic View Post
      If you apply pickListCriteria via editorProperties, that doesn't apply to the filterEditor - use filterEditorProperties for that.
      Thanks for the help and pointer. The subtle I was missing is that I had to set the pickListCriteria and the pickListFilterCriteriaFunction of the ComboBoxItem to be the same criteria, but similarly for the ListGridField object apply setEditorProperties AND setFilterEditorProperties to the ComboBoxItem object. The second setFilterEditorProperties made the filter dropdown match the selection within the List Grid.

      Hope this is clear to someone else.

      Comment

      Working...
      X