8

Did I miss the link that documents ALL the available uiGridConstants for uiGrid fields in one place? I was working on columnDefs filter and found out EQUAL does not work. That's when I realized there is no central documentation for all the condition constants for uiGridConstants.

columnDefs:
 [ {   }
    , { field: '_pointXID', filter
        : {
            condition: uiGridConstants.filter.CONTAINS, placeholder: '%PATTERN%'
        }, headerCellClass: $scope.whatfilter}
    , { field: '_statU16', width: "5%", filter
        : {
            condition: uiGridConstants.filter.EQUAL, placeholder: '=='
        }, headerCellClass: $scope.whatfilter}
    , { field: '_valDoub', width: "5%", enableFiltering: false }

 ]

EQUAL's not one of them, and heck how do I know?!

Jenna Leaf
  • 2,255
  • 21
  • 29

2 Answers2

10

Looks like I have to open up the source ui-Grid.js to find “uiGridConstants.filter.” literals in the code. Here it is, my summary for all the ui-grid’s available filter conditions in these constants 

1.  STARTS_WITH
2.  ENDS_WITH
3.  CONTAINS 
4.  EXACT
5.  NOT_EQUAL
6.  GREATER_THAN
7.  GREATER_THAN_OR_EQUAL
8.  LESS_THAN
9.  LESS_THAN_OR_EQUAL

Have I got all of them or still missed something? (Notice that I can’t locate EQUAL in the source, instead, EXACT!)

You guys are asking of whether there is a default condition. I don't believe there's one, but if your input filter.condition value is not any of the above, your Column filter will return a TRUE which means you have no filters!

So in other words, the default is NO FILTERS : anything goes if your condition constant is not valid

Jenna Leaf
  • 2,255
  • 21
  • 29
0

Here be central documentation now

It says:

Used in columnDef.filter to configure filtering on the column

SELECT and INPUT are used with the type property of the filter, the rest are used to specify one of the built-in conditions.

Available condition options are:

  • uiGridConstants.filter.STARTS_WITH
  • uiGridConstants.filter.ENDS_WITH
  • uiGridConstants.filter.CONTAINS
  • uiGridConstants.filter.GREATER_THAN
  • uiGridConstants.filter.GREATER_THAN_OR_EQUAL
  • uiGridConstants.filter.LESS_THAN
  • uiGridConstants.filter.LESS_THAN_OR_EQUAL
  • uiGridConstants.filter.NOT_EQUAL

Available type options are:

  • uiGridConstants.filter.SELECT - use a dropdown box for the cell header filter field
  • uiGridConstants.filter.INPUT - use a text box for the cell header filter field