Comparison Search Field

Last update: Edit

Introduction

To add a comparison search field to your data grid, right-click within the search bar in your data grid and choose Add search field > Comparison.

Common Properties

Caption

The caption is the text that is shown in front of the actual search field. This is a translatable text. See Translatable Texts.

Type

Value Description
Normal The search field is visible and editable by the end user.
Hidden The search field is hidden and is only there to selectively display objects in the grid.
Read-only The search field is visible but not editable by the end user.
A hidden search field is an easy way to selectively display the contents of a grid. For example, a grid showing cars and their colors can be limited to only showing red cars by adding a hidden search field on color with default value 'red'.

Default Value

The default value is the initial value for the search field. In the case of a normal search field, this value can then be edited by the end user. In the case of a hidden or read-only search field the value is fixed.

Custom Date Format

Available only for attributes of the date and time type.

This property determines how the entered value is formatted. The custom date format is a string that allows for any combination of symbols found in the table below. Any punctuation will be rendered literally.

All examples are for 30th December 2014, at 00:27:16.789

Symbol Example Description
G AD The era
y, yyy, yyyy, etc. 2014 Year
yy 14 Year
Y, YYY, YYYY, etc. 2015 Week year, use in combination with w for week number formatting
YY 15 Week year, use in combination with w for week number formatting
M, MM* 12 Month number
MMM Dec Month abbreviation
MMMM December Month name
w, ww* 1 Week of year, use for week number formatting
d, dd* 30 Day of month
D, DD, DDD 364 Day of year
a AM AM or PM
h, hh* 12 Hour (1-12)
H, HH* 00 Hour (0-23)
k, kk* 24 Hour (1-24)
K, KK* 00 Hour (0-11)
m, mm* 27 Minute
s, ss* 16 Second
S, SS, SSS 789 Milliseconds
E, EE 05 Day of week number
EEE Tue Day of week abbreviation
EEEE Tuesday Day of week name
z, zz, zzz, zzzz Pacific Standard Time Time zone
Z, ZZ, ZZZ -04:00 Time zone offset
ZZZZ GMT-04:00 Time zone offset

*two characters pads with zero

These are some examples:

Format Example Output
EEEE d MMMM yyy G, h:mm a ss's' Tuesday 30 December 2014 AD, 12:27 AM 16s
h:mm a 12:27 AM
yyy D KK:mm 2014 364 00:27
EEEE MMMM d yyy Tuesday December 30 2014
EEE, MMM dd, ''yy Tue, Dec 30, ‘14
EEEE, 'week' ww YYYY Tuesday, week 01 2015

Placeholder Text

Available only for attributes of the date and time type.

The placeholder text is shown if the search input is empty. It can be used to give the end-user a hint as to the expected format. Note: placeholder texts will not work if a native date picker is available (for example, on iOS and Android versions 4.0 and above).

General Properties

Attribute (Path)

The text that is entered into the search field is searched for in the given attribute. For each object in the grid, the attribute is inspected to see whether it matches the value that is being searched.

The attribute can be an attribute of the entity in the data grid but also an attribute of an associated entity (an attribute path). The path can follow any number of associations of type reference and optionally a reference set at the end. If you use a reference set all references will be checked for possible matches.

The table below shows the types of the attributes that are allowed in search fields.

Search field Allowed direct attributes Allowed associated attributes
Comparison AutoNumber, Currency, Date, Decimal, Float, Integer, Long, String AutoNumber, Currency, Date, Decimal, Float, Integer, Long, String
Drop-down Boolean, Enumeration AutoNumber, Boolean (added in 5.5.0), Currency, Decimal, Enumeration, Float, Integer, Long, String

Comparison

The value entered by the end user (or the default value in the case of hidden and read-only search fields) is compared to the value of the attribute of each of the objects in the grid. If the match succeeds, the object will be part of the search result. There are different ways in which the attribute value and the entered value can be compared. In the third column below you see the type of search field for which the comparison operator is allowed.

Value Description Search field types
Contains Does the attribute value contain the entered value? Text (attribute must be of type String)
Starts with Does the attribute value start with the entered value? Text (attribute must be of type String)
Greater Is the attribute value greater than the entered value? Text, Date
Greater or equal Is the attribute value greater than or equal to the entered value? Text, Date
Equal Is the attribute value the same as the entered value? Text, Date, Drop-down
Not equal Is the attribute value not the same as the entered value? Text, Date, Drop-down
Smaller or equal Is the attribute value smaller than or equal to the entered value? Text, Date
Smaller Is the attribute value smaller than the entered value? Text, Date

Default value: Equal

Date comparisons and the influence of the default value

It is possible to search on date attributes using equality. What happens with the time component belonging to the date is dependent on the default value of the comparison search field.

Default value Search query Result example (input: August 4, 2100)
None Search field is empty. Represents a 24 hour date range starting at midnight of the specified date. Search between August 4, 0:00 - August 5, 0:00
[%CurrentDateTime%] Search field shows the current date. Represents a 24 hour date range starting at the current time. Search between August 4, and August 5,
[%BeginOfCurrentDay%] Search field shows the current date. Represents a 24 hour date range starting at midnight of the specified date. Search between August 4, 0:00 - August 5, 0:00