Skip to content

Commit a19f77a

Browse files
Merge pull request #390 from Syncfusion-Content/hotfix/hotfix-v20.3.0.47
DOCINFRA-2341_merged_using_automation
2 parents 64cecc1 + b5d718b commit a19f77a

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

Flutter/datagrid/filtering.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ documentation: ug
99

1010
# Filtering in Flutter DataGrid (SfDataGrid)
1111

12-
Filtering is the process of fetching the values from a collection that satisfies a specified condition. In the `SfDataGrid`, filtering can be applied through the UI and programmatically.
12+
Filtering is the process of fetching the values from a collection that satisfies a specified condition. In the [SfDataGrid](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid-class.html), filtering can be applied through the UI and programmatically.
1313

1414
## Programmatical Filtering
1515

16-
The SfDataGrid allows you to filter the data rows programmatically by adding the filter conditions along with the respective column name to the `DataGridSource.filterConditions` map collection. In the map collection, the `key` defines the `columnName` and the `values` defines the list of `FilterCondition`.
16+
The SfDataGrid allows you to filter the data rows programmatically by adding the filter conditions along with the respective column name to the [DataGridSource.filterConditions](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/DataGridSource/filterConditions.html) map collection. In the map collection, the `key` defines the [columnName](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/GridColumn/columnName.html) and the `values` defines the list of [FilterCondition](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/FilterCondition-class.html).
1717

1818
`DataGridSource.filterConditions` is an unmodifiable map collection. So, it doesn't allow us to perform CRUD operations directly in the `DataGridSource.filterConditions` property. However, it can be done by the following public methods:
1919

2020
### Add filter
2121

22-
A filter condition to the specific column can be added by the `DataGridSource.addFilter` method.
22+
A filter condition to the specific column can be added by the [DataGridSource.addFilter](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/DataGridSource/addFilter.html) method.
2323

2424
{% tabs %}
2525
{% highlight Dart %}
@@ -83,7 +83,7 @@ Widget build(BuildContext context) {
8383

8484
### Remove filter
8585

86-
A filter condition to the specific column can be removed by the `DataGridSource.removeFilter` method.
86+
A filter condition to the specific column can be removed by the [DataGridSource.removeFilter](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/DataGridSource/removeFilter.html) method.
8787

8888
{% tabs %}
8989
{% highlight Dart %}
@@ -154,7 +154,7 @@ Widget build(BuildContext context) {
154154

155155
### Clear filter
156156

157-
The filter conditions from the entire column can be cleared by the `DataGridSource.clearFilters` method. The filter conditions in the specific column can also be cleared by invoking the `DataGridSource.clearFilters` method along with the corresponding `columnName` as an argument.
157+
The filter conditions from the entire column can be cleared by the [DataGridSource.clearFilters](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/DataGridSource/clearFilters.html) method. The filter conditions in the specific column can also be cleared by invoking the `DataGridSource.clearFilters` method along with the corresponding `columnName` as an argument.
158158

159159
{% tabs %}
160160
{% highlight Dart %}
@@ -217,7 +217,7 @@ Widget build(BuildContext context) {
217217

218218
### Filter behavior
219219

220-
The `FilterBehavior` property is used to specify whether filtering should consider the value of a cell as the string or its data type
220+
The [FilterBehavior](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/FilterBehavior.html) property is used to specify whether filtering should consider the value of a cell as the string or its data type
221221

222222
* **stringDataType** - It converts the cell value as string data type and compares the condition.
223223
* **strongDataType** - It compares the cell value with its actual data type.
@@ -290,7 +290,7 @@ Widget build(BuildContext context) {
290290

291291
### Filter operator
292292

293-
The `FilterOperator` property is used to decide how a logical operator is to be applied between multiple filter conditions.
293+
The [FilterOperator](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/FilterOperator.html) property is used to decide how a logical operator is to be applied between multiple filter conditions.
294294

295295
* **and** - `AND` logical operator applies between multiple filter conditions.
296296
* **or** - `OR` logical operator applies between multiple filter conditions.
@@ -372,7 +372,7 @@ Widget build(BuildContext context) {
372372

373373
### Filter rows with a range between two dates
374374

375-
The column which holds the `DateTime` type data can be filtered with a range between two dates by applying the two filter conditions to the same column. The `FilterType` for the filter condition with the start date should be `GreaterThanOrEqual` and the end date should be `LessThanOrEqual` and the `FilterOperator` for the filter condition should be `and`.
375+
The column which holds the [DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html) type data can be filtered with a range between two dates by applying the two filter conditions to the same column. The [FilterType](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/FilterType.html) for the filter condition with the start date should be `GreaterThanOrEqual` and the end date should be `LessThanOrEqual` and the `FilterOperator` for the filter condition should be `and`.
376376

377377
{% tabs %}
378378
{% highlight Dart %}
@@ -455,7 +455,7 @@ After filtering, the rows can be retrieved in the same order as displayed in the
455455

456456
## UI Filtering
457457

458-
The `SfDataGrid` provides an excel-like filtering UI and an advanced filter UI to filter the data easily. UI filtering can be enabled by setting the `SfDataGrid.allowFiltering` property to `true`. This allows the filter UI to be opened by clicking on the filter icon in the column header. The filtering UI will be shown as a popup menu on the desktop and web platforms, and it will be shown as a new page on the mobile platforms.
458+
The `SfDataGrid` provides an excel-like filtering UI and an advanced filter UI to filter the data easily. UI filtering can be enabled by setting the [SfDataGrid.allowFiltering](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid/allowFiltering.html) property to `true`. This allows the filter UI to be opened by clicking on the filter icon in the column header. The filtering UI will be shown as a popup menu on the desktop and web platforms, and it will be shown as a new page on the mobile platforms.
459459

460460
The `SfDataGrid` provides the following types of filter popup modes:
461461

@@ -472,8 +472,12 @@ The following image shows the advanced filter popup menu on the web and desktop
472472

473473
The following images show the checkbox and advanced filter popup menu on the mobile platform,
474474

475-
| ![Flutter datagrid shows a checkbox filter in mobile platform](images/filtering/flutter-datagrid-checkbox-filter-view-mobile.png) | ![Flutter datagrid shows a advanced filter in mobile platform](images/filtering/flutter-datagrid-advanced-filter-view-mobile.png) |
476-
|:---:|:---:|
475+
<table>
476+
<tr>
477+
<th><img alt="Flutter datagrid shows a checkbox filter menu on mobile platform" src="images/filtering/flutter-datagrid-checkbox-filter-view-mobile.png"/></td>
478+
<th><img alt="Flutter datagrid shows a advanced filter menu on mobile platform" src="images/filtering/flutter-datagrid-advanced-filter-view-mobile.png"/></td>
479+
</tr>
480+
</table>
477481

478482
### Checkbox filtering
479483

@@ -494,7 +498,7 @@ Below are the built-in filter types supported:
494498

495499
* **Text Filters** – Loads various menu options to filter the display text effectively.
496500
* **Number Filters** – Loads various menu options to filter the numeric data.
497-
* **Date Filters** – Loads various menu options and `DatePicker` to filter DateTime type column.
501+
* **Date Filters** – Loads various menu options and [DatePicker](https://api.flutter.dev/flutter/material/showDatePicker.html) to filter DateTime type column.
498502

499503
<table>
500504
<tr>
@@ -517,7 +521,7 @@ Below are the built-in filter types supported:
517521
<td align="left" valign="top"><b>Filter menu options</b> <ul><li>Equals</li> <li>Does Not Equal</li> <li>Less Than</li> <li>Less Than Or Equal</li> <li>Greater Than</li> <li>Greater Than Or Equal</li> <li>Null</li> <li>Not Null</li></ul> </td>
518522
<td align="left" valign="top"><b>Filter menu options</b> <ul><li>Equals</li> <li>Does Not Equal</li> <li>Before</li> <li>Before Or Equal</li> <li>After</li> <li>After Or Equal</li> <li>Null</li> <li>Not Null</li></ul> </td>
519523
</tr>
520-
<table>
524+
</table>
521525

522526
The following image shows the advanced filter popup menu with multiple filter values and types in order to filter the range of data rows,
523527

@@ -537,7 +541,7 @@ The following image shows the advanced filter popup menu with a case-sensitive i
537541

538542
### Disable filtering for an individual column
539543

540-
The `GridColumn.allowFiltering` has a higher priority than the `SfDataGrid.allowFiltering` property. So, you can disable the filtering for any particular column by setting the `GridColumn.allowFiltering` property to `false`.
544+
The [GridColumn.allowFiltering](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/GridColumn/allowFiltering.html) has a higher priority than the `SfDataGrid.allowFiltering` property. So, you can disable the filtering for any particular column by setting the `GridColumn.allowFiltering` property to `false`.
541545

542546
{% tabs %}
543547
{% highlight Dart %}
@@ -597,7 +601,7 @@ The SfDataGrid provides the following callbacks to notify the filtering stages:
597601

598602
### OnFilterChanging callback
599603

600-
`onFilterChanging` callback invokes when the filtering is being applied to the particular column through UI filtering. You can return `false` from this callback to restrict the column from being filtered.
604+
[onFilterChanging](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid/onFilterChanging.html) callback invokes when the filtering is being applied to the particular column through UI filtering. You can return `false` from this callback to restrict the column from being filtered.
601605

602606
{% tabs %}
603607
{% highlight Dart %}
@@ -658,7 +662,7 @@ Widget build(BuildContext context) {
658662

659663
### OnFilterChanged callback
660664

661-
`onFilterChanged` callback invokes after the filtering is applied to the particular column through UI filtering. You can use this callback to get filter conditions.
665+
[onFilterChanged](https://pub.dev/documentation/syncfusion_flutter_datagrid/latest/datagrid/SfDataGrid/onFilterChanged.html) callback invokes after the filtering is applied to the particular column through UI filtering. You can use this callback to get filter conditions.
662666

663667
{% tabs %}
664668
{% highlight Dart %}

0 commit comments

Comments
 (0)