Vue FilterBuilder Props
An object defining the FilterBuilder widget's configuration options.
accessKey
Specifies the shortcut key that sets focus on the widget.
The value of this option will be passed to the accesskey
attribute of the HTML element that underlies the widget.
activeStateEnabled
Specifies whether or not the widget changes its state when interacting with a user.
This option is used when the widget is displayed on a platform whose guidelines include the active state change for widgets.
allowHierarchicalFields
Specifies whether the widget can display hierarchical data fields.
See Also
elementAttr
Specifies the attributes to be attached to the widget's root element.
You can configure this option in an ASP.NET MVC Control as follows:
@(Html.DevExtreme().WidgetName() .ElementAttr("class", "class-name") // ===== or ===== .ElementAttr(new { @id = "elementId", @class = "class-name" }) // ===== or ===== .ElementAttr(new Dictionary<string, object>() { { "id", "elementId" }, { "class", "class-name" } }) )
@(Html.DevExtreme().WidgetName() _ .ElementAttr("class", "class-name") ' ===== or ===== .ElementAttr(New With { .id = "elementId", .class = "class-name" }) ' ===== or ===== .ElementAttr(New Dictionary(Of String, Object) From { { "id", "elementId" }, { "class", "class-name" } }) )
fields
Configures fields.
This option accepts an array of objects, each configuring a filter condition's appearance. Each condition consists of a data field, operation and value. A logical operation can combine conditions on the same level in a group.
See the Field section for details on fields you can specify in each object.
focusStateEnabled
Specifies whether the widget can be focused using keyboard navigation.
height
Specifies the widget's height.
This option accepts a value of one of the following types:
Number
The height in pixels.String
A CSS-accepted measurement of height. For example,"55px"
,"80%"
,"auto"
,"inherit"
.Function
A function returning either of the above. For example:JavaScriptheight: function() { return window.innerHeight / 1.5; }
hint
Specifies text for a hint that appears when a user pauses on the widget.
hoverStateEnabled
Specifies whether the widget changes its state when a user pauses on it.
onDisposing
A handler for the disposing event. Executed when the widget is removed from the DOM using the remove(), empty(), or html() jQuery methods only.
Information about the event.
Name | Type | Description |
---|---|---|
component |
The widget's instance. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
model |
The model data. Available only if you use Knockout. |
onEditorPrepared
A handler for the editorPrepared event. Executed after an editor is created.
Information about the event.
Name | Type | Description |
---|---|---|
component |
The widget's instance. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
model |
The model data. Available only if you use Knockout. |
|
value | any |
The editor's value. |
setValue(newValue) | any |
A method that you need to call to change the data field's value after the editor's value is changed. |
editorElement |
The editor's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
editorName |
The editor's name. |
|
dataField |
The data field's name. |
|
updateValueTimeout |
Gets and sets the delay between when a user stops typing a field value and when it is applied. |
|
width |
The editor's width. |
|
readOnly |
Indicates whether the editor is read-only. |
|
disabled |
Indicates whether the editor is disabled. |
|
rtlEnabled |
Indicates whether the editor uses right-to-left representation. |
The widget offers a user a different editor for entering a value depending on the field's dataType: Calendar, TextBox, SelectBox, etc. You can customize automatically created editors using this handler.
onEditorPreparing
A handler for the editorPreparing event. Executed before an editor is created.
Information about the event.
Name | Type | Description |
---|---|---|
component |
The widget's instance. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
model |
The model data. Available only if you use Knockout. |
|
value | any |
The editor's value. |
setValue(newValue) | any |
A method that you should call to change the data field's value after the editor's value is changed. |
cancel |
Allows you to cancel the creation of the editor. |
|
editorElement |
The editor's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
editorName |
Allows you to change the editor. Accepts names of DevExtreme widgets only, for example, "dxTextBox". |
|
editorOptions |
Gets and sets the editor configuration. |
|
dataField |
The data field's name. |
|
updateValueTimeout |
Gets and sets the delay between when a user stops typing a field value and when it is applied. |
|
width |
The editor's width. |
|
readOnly |
Indicates whether the editor is read-only. |
|
disabled |
Indicates whether the editor is disabled. |
|
rtlEnabled |
Indicates whether the editor uses right-to-left representation. |
The widget offers a user a different editor for entering a value depending on the field's dataType: Calendar, TextBox, SelectBox, etc. Within this handler, you can customize a default editor or substitute it for another DevExtreme editor. To do the latter, assign the editor's name to the editorName field and then configure the editor in the editorOptions object. If you specify the editor's onValueChanged handler, call the setValue(newValue) method in it to update the value.
jQuery
$(function() { $("#filterBuilder").dxFilterBuilder({ // ... onEditorPreparing: function(e) { if (e.dataField == "name") { e.editorName = "dxTextArea"; e.editorOptions.showClearButton = true; e.editorOptions.onValueChanged = function (e) { var value = e.value; if(value == "") { alert("TextArea is empty"); return; } e.setValue(value); } } } }); });
Angular
import { DxFilterBuilderModule } from 'devextreme-angular'; // ... export class AppComponent { onEditorPreparing (e) { if (e.dataField == "name") { e.editorName = "dxTextArea"; e.editorOptions.showClearButton = true; e.editorOptions.onValueChanged = function (e) { var value = e.value; if (value == "") { alert("TextArea is empty"); return; } e.setValue(value); } } } } @NgModule({ imports: [ // ... DxFilterBuilderModule ], // ... })
<dx-filter-builder ... (onEditorPreparing)="onEditorPreparing($event)"> </dx-filter-builder>
If you use a third-party editor, cancel the default editor creation and then implement your one. Call the setValue(newValue) method in the onEditorPreparing handler to notify the FilterBuilder of the changed value.
jQuery
$(function() { $("#filterBuilder").dxFilterBuilder({ // ... onEditorPreparing: function(e) { if(e.dataField === "hidden") { e.cancel = true; $('<input type="checkbox">') .prop("checked", e.value) .on("change", function(args) { e.setValue(args.target.checked); }) .appendTo(e.editorElement); } } }); });
Angular
import { DxFilterBuilderModule } from 'devextreme-angular'; // ... export class AppComponent { onEditorPreparing (e) { if(e.dataField === "hidden") { e.cancel = true; let checkbox = document.createElement("INPUT"); checkbox.setAttribute("type", "checkbox"); checkbox.setAttribute("checked", e.value); checkbox.addEventListener("change", function(args) { e.setValue(args.target.checked); }); e.editorElement.appendChild(checkbox); } } } @NgModule({ imports: [ // ... DxFilterBuilderModule ], // ... })
<dx-filter-builder ... (onEditorPreparing)="onEditorPreparing($event)"> </dx-filter-builder>
onInitialized
A handler for the initialized event. Executed only once, after the widget is initialized.
Information about the event.
Name | Type | Description |
---|---|---|
component |
The widget's instance. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
You cannot access widget elements in this handler because it is executed before they are ready.
onOptionChanged
A handler for the optionChanged event. Executed after an option of the widget is changed.
Information about the event.
Name | Type | Description |
---|---|---|
name |
The option's short name. |
|
model |
The model data. Available only if you use Knockout. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
component |
The widget's instance. |
|
fullName |
The option's full name. |
|
value | any |
The option's new value. |
onValueChanged
A handler for the valueChanged event. Executed after the widget's value is changed.
Information about the event.
Name | Type | Description |
---|---|---|
component |
The widget's instance. |
|
element |
The widget's container. It is an HTML Element or a jQuery Element when you use jQuery. |
|
model |
The model data. Available only if you use Knockout. |
|
value |
The widget's new value. |
|
previousValue |
The widget's previous value. |
rtlEnabled
Switches the widget to a right-to-left representation.
When this option is set to true, the widget text flows from right to left, and the layout of elements is reversed. To switch the entire application/site to the right-to-left representation, assign true to the rtlEnabled field of the object passed to the DevExpress.config(config) method.
DevExpress.config({ rtlEnabled: true });
See Also
- Right-to-Left Support Demo: DataGrid | Navigation Widgets | Editors
tabIndex
Specifies the number of the element when the Tab key is used for navigating.
The value of this option will be passed to the tabindex
attribute of the HTML element that underlies the widget.
width
Specifies the widget's width.
This option accepts a value of one of the following types:
Number
The width in pixels.String
A CSS-accepted measurement of width. For example,"55px"
,"80%"
,"auto"
,"inherit"
.Function
A function returning either of the above. For example:JavaScriptwidth: function() { return window.innerWidth / 1.5; }
If you have technical questions, please create a support ticket in the DevExpress Support Center.