Skip to content

Commit 9a1336c

Browse files
authored
Merge pull request #93 from DHTMLX/comboFilter-initial-sorting-4961
Combo filter default sorting
2 parents 25ad596 + 4204c2b commit 9a1336c

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

docs/grid/configuration.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ If you specify **comboFilter** as the header or footer content of a column, you
14451445
- **placeholder** - (*string*) sets a placeholder in the input of ComboBox
14461446
- **virtual** - (*boolean*) enables dynamic loading of data on scrolling the list of options, *true* by default
14471447
- **template** - (*function*) a function which returns a template with content for the filter options. Takes an option item as a parameter
1448-
1448+
-
14491449
~~~jsx
14501450
{
14511451
id: "category",
@@ -1458,6 +1458,19 @@ If you specify **comboFilter** as the header or footer content of a column, you
14581458

14591459
**Related sample**: [Grid. Header filters (dateFilter, comboFilter, inputFilter, selectFilter](https://snippet.dhtmlx.com/4qz8ng3c)
14601460

1461+
#### Redefining the default sorting for comboFilter
1462+
1463+
By default the elements of the comboFilter are sorted by ID. You can modify the way of sorting elements in this type of the filter inside the handler of the [`beforeOpen`](/combobox/api/combobox_beforeopen_event/) event. For example, you can specify that the options in the comboFilter should be sorted by value in the following way:
1464+
1465+
~~~jsx
1466+
const comboFilter = grid.getHeaderFilter("access").getFilter();
1467+
comboFilter.events.on("beforeOpen", function() {
1468+
comboFilter.data.sort({
1469+
by: "value",
1470+
});
1471+
});
1472+
~~~
1473+
14611474
- **dateFilter**
14621475

14631476
:::tip pro version only

0 commit comments

Comments
 (0)