What are the available condition constants under uiGridConstants.filter?
Asked Answered
B

2

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?!

Betrothed answered 1/6, 2016 at 17:32 Comment(2)
So, what is your question?Woofer
I have edited the question.Betrothed
B
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

Betrothed answered 1/6, 2016 at 17:32 Comment(5)
Nice one... what is the default value please?Pieter
The default is none of the above. It's some hybrid between CONTAINS and something that supports * wildcards only.Lozoya
Ed Griffin, I have your question answered in my modified answer. ThanksBetrothed
You should begin to accept answers the do answer your question(s) by accepting with the checkmark to the left OR provide updates to your question as to why not to get more answers that you can acceptDuodecimal
Jay: the answer to your question. Default is No Filter. Anything goes in selection!Betrothed
L
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
Lcm answered 25/12, 2020 at 2:2 Comment(1)
How to make a multiple select ?Unwished

© 2022 - 2024 — McMap. All rights reserved.