Angular DataGrid - headerFilter.search
Selector: dxo-search
Type:
jQuery
JavaScript
$(function(){ $("#dataGrid").dxDataGrid({ // ... headerFilter: { // ... search: { editorOptions: { placeholder: 'Search value', mode: 'text' }, enabled: true, timeout: 700, mode: 'equals' }, }, }) });
Angular
app.component.html
app.component.ts
app.module.ts
<dx-data-grid ... > <dxo-header-filter ... > <dxo-search [editorOptions]="searchEditorOptions" [enabled]="true" [timeout]="700" mode="equals" ></dxo-search> </dxo-header-filter> </dx-data-grid>
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { searchEditorOptions; constructor() { this.searchEditorOptions = { placeholder: 'Search value', mode: 'text' }; // ... } // ... }
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { DxDataGridModule } from 'devextreme-angular'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, DxDataGridModule ], providers: [ ], bootstrap: [AppComponent] }) export class AppModule { }
Vue
App.vue (Options API)
App.vue (Composition API)
<template> <DxDataGrid ... > <DxHeaderFilter ... > <DxSearch :editor-options="searchEditorOptions" :enabled="true" :timeout="700" mode="equals" /> </DxHeaderFilter> </DxDataGrid> </template> <script> import 'devextreme/dist/css/dx.light.css'; import DxDataGrid, { DxHeaderFilter, DxSearch, // ... } from 'devextreme-vue/data-grid'; export default { components: { DxDataGrid, DxHeaderFilter, DxSearch, // ... }, data() { return { searchEditorOptions: { placeholder: 'Search value', mode: 'text' } }; } } </script>
<template> <DxDataGrid ... > <DxHeaderFilter ... > <DxSearch :editor-options="searchEditorOptions" :enabled="true" :timeout="700" mode="equals" /> </DxHeaderFilter> </DxDataGrid> </template> <script setup> import 'devextreme/dist/css/dx.light.css'; import DxDataGrid, { DxHeaderFilter, DxSearch, // ... } from 'devextreme-vue/data-grid'; const searchEditorOptions = { placeholder: 'Search value', mode: 'text' }; // ... </script>
React
App.js
import React from 'react'; import 'devextreme/dist/css/dx.light.css'; import DataGrid, { HeaderFilter, Search, // ... } from 'devextreme-react/data-grid'; const searchEditorOptions = { placeholder: 'Search value', mode: 'text' }; export default function App() { return ( <DataGrid ... > <HeaderFilter ... > <Search editorOptions={searchEditorOptions} enabled={true} timeout={700} mode="equals" /> </HeaderFilter> </DataGrid> ); }
See Also
editorOptions
Type:
any
Default Value: {}
See the TextBox Configuration topic for information about properties you can specify in this object.
Angular
NOTE
The nested component that configures the editorOptions property does not support event bindings and two-way property bindings.
Vue
NOTE
The nested component that configures the editorOptions property does not support event bindings and two-way property bindings.
jQuery
JavaScript
$(function(){ $("#dataGrid").dxDataGrid({ // ... headerFilter: { // ... search: { editorOptions: { placeholder: 'Search value', mode: 'text', onValueChanged: (e) => { // handle the value change here } }, // ... }, }, }) });
Angular
app.component.html
app.component.ts
app.module.ts
<dx-data-grid ... > <dxo-header-filter ... > <dxo-search [editorOptions]="searchEditorOptions" // ... ></dxo-search> </dxo-header-filter> </dx-data-grid>
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { searchEditorOptions; constructor() { this.searchEditorOptions = { placeholder: 'Search value', mode: 'text', onValueChanged: (e) => { // handle the value change here } }; // ... } // ... }
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { AppComponent } from './app.component'; import { DxDataGridModule } from 'devextreme-angular'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, DxDataGridModule ], providers: [ ], bootstrap: [AppComponent] }) export class AppModule { }
Vue
App.vue (Options API)
App.vue (Composition API)
<template> <DxDataGrid ... > <DxHeaderFilter ... > <DxSearch :editor-options="searchEditorOptions" // ... /> </DxHeaderFilter> </DxDataGrid> </template> <script> import 'devextreme/dist/css/dx.light.css'; import DxDataGrid, { DxHeaderFilter, DxSearch, // ... } from 'devextreme-vue/data-grid'; export default { components: { DxDataGrid, DxHeaderFilter, DxSearch, // ... }, data() { return { searchEditorOptions: { placeholder: 'Search value', mode: 'text', onValueChanged: this.handleValueChange } }; }, methods: { handleValueChange(e) { // handle the value change here } } } </script>
<template> <DxDataGrid ... > <DxHeaderFilter ... > <DxSearch :editor-options="searchEditorOptions" // ... /> </DxHeaderFilter> </DxDataGrid> </template> <script setup> import 'devextreme/dist/css/dx.light.css'; import DxDataGrid, { DxHeaderFilter, DxSearch, // ... } from 'devextreme-vue/data-grid'; const searchEditorOptions = { placeholder: 'Search value', mode: 'text', onValueChanged: (e) => { // handle the value change here } }; // ... </script>
React
App.js
import React from 'react'; import 'devextreme/dist/css/dx.light.css'; import DataGrid, { HeaderFilter, Search, // ... } from 'devextreme-react/data-grid'; const searchEditorOptions = { placeholder: 'Search value', mode: 'text', onValueChanged: (e) => { // handle the value change here } }; export default function App() { return ( <DataGrid ... > <HeaderFilter ... > <Search editorOptions={searchEditorOptions} // ... /> </HeaderFilter> </DataGrid> ); }
See Also
timeout
Specifies a timeout, in milliseconds, during which a user may continue to modify the search value without starting the search operation.
Type:
Default Value: 500
Feel free to share topic-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you for the feedback!
If you have technical questions, please create a support ticket in the DevExpress Support Center.