Skip to content

Commit 02a1034

Browse files
committed
[update] setValue() and getFilter() methods of the grid header filter
1 parent 516646e commit 02a1034

3 files changed

Lines changed: 40 additions & 19 deletions

File tree

docs/grid/api/grid_getheaderfilter_method.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ description: You can explore the getHeaderFilter method of Grid in the documenta
1616
@returns:
1717
An object with a set of methods which let you work with the header filter of the specified column. The methods are:
1818

19-
- [blur()](grid/api/headerfilter/blur_method.md) - removes focus from the filter
20-
- [clear()](grid/api/headerfilter/clear_method.md) - clears the value set in the filter
21-
- [focus()](grid/api/headerfilter/focus_method.md) - sets focus on the filter
22-
- [getFilter()](grid/api/headerfilter/getfilter_method.md) - returns either an HTML object or an object with Combobox configuration
23-
- [setValue()](grid/api/headerfilter/setvalue_method.md) - sets a value by which a column will be filtered
19+
- [`blur()`](grid/api/headerfilter/blur_method.md) - removes focus from the filter
20+
- [`clear()`](grid/api/headerfilter/clear_method.md) - clears the value set in the filter
21+
- [`focus()`](grid/api/headerfilter/focus_method.md) - sets focus on the filter
22+
- [`getFilter()`](grid/api/headerfilter/getfilter_method.md) - returns either an HTML object, or an object with Combobox/Calendar configuration
23+
- [`setValue()`](grid/api/headerfilter/setvalue_method.md) - sets the filter value
2424

2525
@example:
2626
const countryFilter = grid.getHeaderFilter("country");

docs/grid/api/headerfilter/getfilter_method.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,24 @@ description: You can explore the getFilter method of the header filter of Grid i
66

77
# getFilter()
88

9-
@short: returns either an HTML object or an object with Combobox configuration
9+
@short: returns either an HTML object, or an object with Combobox/Calendar configuration
1010

11-
@signature: {'getFilter(): HTML object | Combobox;'}
11+
@signature: {'getFilter(): VNode | Combobox | Calendar;'}
1212

1313
@returns:
14-
Either an HTML object or an object with Combobox configuration
14+
Either an HTML object, or an object with Combobox/Calendar configuration
1515

1616
@example:
1717
const filter1 = grid.getHeaderFilter("country").getFilter();
1818
console.log(filter1);
1919
// -> returns Combobox
20-
//  {config: {…}, _uid: 'u1670500020936', events: o, data: d, popup: f, …}
21-
20+
// { config: {...}, _uid: 'u1670500020936', events: o, data: d, popup: f, ... }
2221

2322
const filter2 = grid.getHeaderFilter("netChange").getFilter();
2423
console.log(filter2);
2524
// -> returns an HTML object
26-
// {type: 1, attrs: {…}, tag: 'div', _class: 'dhx_grid-filter__label dxi dxi-magnify',
27-
// ref: 'netChange_filter', …}
25+
// { type: 1, attrs: {...}, tag: 'div', _class: 'dhx_grid-filter__label dxi dxi-magnify', ref: 'netChange_filter', ... }
2826

2927
@changelog:
30-
added in v8.0
28+
- The method may return an object with Calendar configuration since v9.3
29+
- Added in v8.0

docs/grid/api/headerfilter/setvalue_method.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,41 @@ description: You can explore the setValue method of the header filter of Grid in
1010

1111
@signature: {'setValue(value: string | string[] | Date | Date[]): void;'}
1212

13-
@params:
14-
- `value: string | string[] | Date | Date[]` - the value to be set for the filter
13+
@descr:
14+
#### Usage
1515

16-
:::info
17-
- An array of string values can be specified only for [`comboFilter`](/grid/configuration/#customizing-headerfooter-filters) in the `multiselection:true` mode.
16+
- for inputFilter, selectFilter, comboFilter
1817

19-
- For [`dateFilter`](/grid/configuration/#customizing-headerfooter-filters), the value must be passed strictly as a *Date* object (for a single selection) or an array of *Date[]* objects (for the `range` mode). *String* values are not supported by the `setValue()` method for this filter type.
20-
:::
18+
~~~jsx
19+
setValue(value: string): void;
20+
~~~
21+
22+
- for comboFilter
23+
24+
~~~jsx
25+
setValue(value: string | string[]): void;
26+
~~~
27+
28+
- for dateFilter
29+
30+
~~~jsx
31+
setValue(value: Date | Date[]): void;
32+
~~~
33+
34+
@params:
35+
- `value: string | string[] | Date | Date[]` - the value to be set for the filter
2136

2237
@example:
2338
grid.getHeaderFilter("country").setValue("Brazil");
2439

2540
@descr:
41+
:::info
42+
The [`dateFilter`](/grid/configuration/#headerfooter-filters) type of filter supports only the *Date object* values.
43+
:::
44+
45+
Note that in case of the enabled `multiselection` or `range` modes, the method awaits the value to be passed as an array.
46+
47+
**Related article**: [Header/footer filters](/grid/configuration/#headerfooter-filters)
2648

2749
@changelog:
2850

0 commit comments

Comments
 (0)