WjFlexGridFilter Class

File
wijmo.angular2.js
Module
wijmo/wijmo.angular2.grid.filter
Base Class
FlexGridFilter
Show
   

Angular 2 component for the FlexGridFilter control.

The wj-flex-grid-filter component must be contained in a WjFlexGrid component.

Use the wj-flex-grid-filter component to add FlexGridFilter controls to your Angular 2 applications. For details about Angular 2 markup syntax, see Angular 2 Markup.

The WjFlexGridFilter component is derived from the FlexGridFilter control and inherits all its properties, events and methods.

Constructor

Properties

Methods

Events

Constructor

constructor

constructor(grid: FlexGrid): FlexGridFilter

Initializes a new instance of the FlexGridFilter class.

Parameters
Inherited From
FlexGridFilter
Returns
FlexGridFilter

Properties

defaultFilterType

Gets or sets the default filter type to use.

This value can be overridden in filters for specific columns. For example, the code below creates a filter that filters by conditions on all columns except the "ByValue" column:

var f = new wijmo.grid.filter.FlexGridFilter(flex);
f.defaultFilterType = wijmo.grid.filter.FilterType.Condition;
var col = flex.columns.getColumn('ByValue'),
    cf = f.getColumnFilter(col);
cf.filterType = wijmo.grid.filter.FilterType.Value;
Inherited From
FlexGridFilter
Type
FilterType

filterAppliedNg

Angular (EventEmitter) version of the Wijmo filterApplied event for programmatic access. Use this event name if you want to subscribe to the Angular version of the event in code. In template bindings use the conventional filterApplied Wijmo event name.

Type
EventEmitter

filterChangedNg

Angular (EventEmitter) version of the Wijmo filterChanged event for programmatic access. Use this event name if you want to subscribe to the Angular version of the event in code. In template bindings use the conventional filterChanged Wijmo event name.

Type
EventEmitter

filterChangingNg

Angular (EventEmitter) version of the Wijmo filterChanging event for programmatic access. Use this event name if you want to subscribe to the Angular version of the event in code. In template bindings use the conventional filterChanging Wijmo event name.

Type
EventEmitter

filterColumns

Gets or sets an array containing the names or bindings of the columns that have filters.

Setting this property to null or to an empty array adds filters to all columns.

Inherited From
FlexGridFilter
Type
string[]

filterDefinition

Gets or sets the current filter definition as a JSON string.

Inherited From
FlexGridFilter
Type
string

grid

Gets a reference to the FlexGrid that owns this filter.

Inherited From
FlexGridFilter
Type
FlexGrid

initialized

This event is triggered after the component has been initialized by Angular, that is all bound properties have been assigned and child components (if any) have been initialized.

Type
EventEmitter

isInitialized

Indicates whether the component has been initialized by Angular. Changes its value from false to true right before triggering the initialized event.

Type
boolean

showFilterIcons

Gets or sets a value indicating whether the FlexGridFilter adds filter editing buttons to the grid's column headers.

If you set this property to false, then you are responsible for providing a way for users to edit, clear, and apply the filters.

Inherited From
FlexGridFilter
Type
boolean

showSortButtons

Gets or sets a value indicating whether the filter editor should include sort buttons.

By default, the editor shows sort buttons like Excel does. But since users can sort columns by clicking their headers, sort buttons in the filter editor may not be desirable in some circumstances.

Inherited From
FlexGridFilter
Type
boolean

wjProperty

Gets or sets a name of a property that this component is assigned to. Default value is ''.

Type
string

Methods

apply

apply(): void

Applies the current column filters to the grid.

Inherited From
FlexGridFilter
Returns
void

clear

clear(): void

Clears all column filters.

Inherited From
FlexGridFilter
Returns
void

closeEditor

closeEditor(): void

Closes the filter editor.

Inherited From
FlexGridFilter
Returns
void

created

created(): void

If you create a custom component inherited from a Wijmo component, you can override this method and perform necessary initializations that you usually do in a class constructor. This method is called in the last line of a Wijmo component constructor and allows you to not declare your custom component's constructor at all, thus preventing you from a necessity to maintain constructor parameters and keep them in synch with Wijmo component's constructor parameters.

Returns
void

editColumnFilter

editColumnFilter(col: any, ht?: HitTestInfo): void

Shows the filter editor for the given grid column.

Parameters
Inherited From
FlexGridFilter
Returns
void

getColumnFilter

getColumnFilter(col: any, create?: boolean): ColumnFilter

Gets the filter for the given column.

Parameters
Inherited From
FlexGridFilter
Returns
ColumnFilter

onFilterApplied

onFilterApplied(e?: EventArgs): void

Raises the filterApplied event.

Parameters
Inherited From
FlexGridFilter
Returns
void

onFilterChanged

onFilterChanged(e: CellRangeEventArgs): void

Raises the filterChanged event.

Parameters
Inherited From
FlexGridFilter
Returns
void

onFilterChanging

onFilterChanging(e: CellRangeEventArgs): void

Raises the filterChanging event.

Parameters
Inherited From
FlexGridFilter
Returns
void

Events

filterApplied

Occurs after the filter is applied.

Inherited From
FlexGridFilter
Arguments
EventArgs

filterChanged

Occurs after a column filter has been edited by the user.

Use the event parameters to determine the column that owns the filter and whether changes were applied or canceled.

Inherited From
FlexGridFilter
Arguments
CellRangeEventArgs

filterChanging

Occurs when a column filter is about to be edited by the user.

Use this event to customize the column filter if you want to override the default settings for the filter.

For example, the code below sets the operator used by the filter conditions to 'contains' if they are null:

filter.filterChanging.addHandler(function (s, e) {
  var cf = filter.getColumnFilter(e.col);
  if (!cf.valueFilter.isActive && cf.conditionFilter.condition1.operator == null) {
    cf.filterType = wijmo.grid.filter.FilterType.Condition;
    cf.conditionFilter.condition1.operator = wijmo.grid.filter.Operator.CT;
  }
});
Inherited From
FlexGridFilter
Arguments
CellRangeEventArgs