SMART datagrid v.1 > Examples

[ grids ver.1.3.8]   Back  Forward

Column Auto Filtering  Example

Column Auto Filter is a filtering device, which sets autoFilter property of the data column to display the values contained in the column excluding the overlapped ones as the criteria, and gets the data rows only corresponding to the selected items to the grid row. It can be used in conjunction with the existing Column Filter. And, if there is a large number of items, you can specify valueScale and filter by a range rather than an individual item. 

In the example below, it displays Auto Filter settings depending on the data type. 

1. Text Field

Auto filter has been set in "Product name" and "Customer name" columns, and Column filter and Auto filter have been set together in "Country" column. And, only Column filter has been set in "Currency" column. 

ColumnAutoFilter.valueScale has been specified as 2 in "Product name" column to select when the first two letters are the same and -2 in "Customer name" column to select when the last two letters are the same. Also, it has specified ignoreCase as true and displayCase as TextCase.UPPER to display capital letters in the selection box. 

active state of Auto filter in "Product name" column. 

displayCount: displayCount of Auto filter in "Product name" column. The number of items displayed in the filter list.
displayCase: displayCase of Auto filter in "Product name" column.
Grid - 1
rows

Select Auto filter of "Country" column by the value of the selected row. v 1.3.8 

Select Auto filter of "Country" column by the value of the selected rows. v 1.3.8 

Remove all Auto filter selections of "Country" column. v 1.3.8 

2. Number Field

If it is NUMBER field, valueScale of Auto filter enables to filter by the range value which has been converted to a multiple of 10. If valueScale is greater than 0, the values multiplied 10 squares (valueScale - 1) will be filtered as belonging to the same range, and if it is smaller than 0, they will be filtered with the range value multiplied - 10 squares as much as valueScale. 

In the example below, valueScale has been set as 2 in "Unit Price" column, so "111.15" and "115.45" will be filtered by the range value of "110"

You can specify ColumnAutoFilter.editSize, FilterSelectorOptions.minWidth, FilterSelectorOptions.maxWidth to explicitly specify the width of the filter selection box. 

The sort direction of Auto filter items in "Unit Price" column
editSize: The Size of the search editor of Auto filter box in "Quantity" column
Grid - 2
rows
3. Date Time Field

valueScale of the column, which is connected to DATETIME field, is used as a range value as DateTimeScale constant value. For example, as in "Order Date" column below, if valueScale is specified as DateTimeScale.QUARTER, the date values contained in the same quarter will be filtered as the date value of the same range. Since "Ship Date" column has been set as DateTimeScale.DATE, it will be filtered as the same value if the year, month and day are the same while the time value is different. 

valueScale of Auto filter in "Order Date" column:
Grid - 3
rows
4. Boolean Field

If it is the case of BOOLEAN field, a value among false, true, undefined will be displayed in the filter list. If booleanFormat is set in the column styles, the string will be displayed according to that format. In the example below, it has been set as "Female;Male;-"

Grid - 4
rows

View Source JSP 

See Also
ColumnAutoFilter
DataColumn.autoFilter
DataColumn.filters
TextCase
DateTimeScale
Examples
Column Filtering