igniteui-angular 21.1.0-rc.4 → 21.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/fesm2022/igniteui-angular-grids-core.mjs +5 -3
- package/fesm2022/igniteui-angular-grids-core.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-grid.mjs +6 -1
- package/fesm2022/igniteui-angular-grids-grid.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-hierarchical-grid.mjs +1 -0
- package/fesm2022/igniteui-angular-grids-hierarchical-grid.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-lite.mjs +2 -0
- package/fesm2022/igniteui-angular-grids-lite.mjs.map +1 -1
- package/fesm2022/igniteui-angular-simple-combo.mjs +1 -1
- package/fesm2022/igniteui-angular-simple-combo.mjs.map +1 -1
- package/lib/core/styles/components/grid/_grid-theme.scss +4 -1
- package/migrations/migration-collection.json +7 -0
- package/migrations/update-21_1_0_add-agent-skills/index.d.ts +3 -0
- package/migrations/update-21_1_0_add-agent-skills/index.js +46 -0
- package/package.json +4 -4
- package/skills/igniteui-angular-components/SKILL.md +71 -0
- package/skills/igniteui-angular-components/references/charts.md +447 -0
- package/skills/igniteui-angular-components/references/data-display.md +347 -0
- package/skills/igniteui-angular-components/references/directives.md +149 -0
- package/skills/igniteui-angular-components/references/feedback.md +141 -0
- package/skills/igniteui-angular-components/references/form-controls.md +298 -0
- package/skills/igniteui-angular-components/references/layout-manager.md +415 -0
- package/skills/igniteui-angular-components/references/layout.md +216 -0
- package/skills/igniteui-angular-components/references/setup.md +157 -0
- package/skills/igniteui-angular-grids/SKILL.md +110 -0
- package/skills/igniteui-angular-grids/references/data-operations.md +436 -0
- package/skills/igniteui-angular-grids/references/editing.md +480 -0
- package/skills/igniteui-angular-grids/references/features.md +218 -0
- package/skills/igniteui-angular-grids/references/paging-remote.md +388 -0
- package/skills/igniteui-angular-grids/references/state.md +448 -0
- package/skills/igniteui-angular-grids/references/structure.md +290 -0
- package/skills/igniteui-angular-grids/references/types.md +428 -0
- package/skills/igniteui-angular-theming/SKILL.md +530 -0
- package/styles/igniteui-angular-dark.css +1 -1
- package/styles/igniteui-angular.css +1 -1
- package/styles/igniteui-bootstrap-dark.css +1 -1
- package/styles/igniteui-bootstrap-light.css +1 -1
- package/styles/igniteui-dark-green.css +1 -1
- package/styles/igniteui-fluent-dark-excel.css +1 -1
- package/styles/igniteui-fluent-dark-word.css +1 -1
- package/styles/igniteui-fluent-dark.css +1 -1
- package/styles/igniteui-fluent-light-excel.css +1 -1
- package/styles/igniteui-fluent-light-word.css +1 -1
- package/styles/igniteui-fluent-light.css +1 -1
- package/styles/igniteui-indigo-dark.css +1 -1
- package/styles/igniteui-indigo-light.css +1 -1
- package/styles/maps/igniteui-angular-dark.css.map +1 -1
- package/styles/maps/igniteui-angular.css.map +1 -1
- package/styles/maps/igniteui-bootstrap-dark.css.map +1 -1
- package/styles/maps/igniteui-bootstrap-light.css.map +1 -1
- package/styles/maps/igniteui-dark-green.css.map +1 -1
- package/styles/maps/igniteui-fluent-dark-excel.css.map +1 -1
- package/styles/maps/igniteui-fluent-dark-word.css.map +1 -1
- package/styles/maps/igniteui-fluent-dark.css.map +1 -1
- package/styles/maps/igniteui-fluent-light-excel.css.map +1 -1
- package/styles/maps/igniteui-fluent-light-word.css.map +1 -1
- package/styles/maps/igniteui-fluent-light.css.map +1 -1
- package/styles/maps/igniteui-indigo-dark.css.map +1 -1
- package/styles/maps/igniteui-indigo-light.css.map +1 -1
- package/types/igniteui-angular-grids-lite.d.ts +2 -0
|
@@ -0,0 +1,448 @@
|
|
|
1
|
+
# Grid State Persistence & Grid-Type-Specific Operations
|
|
2
|
+
|
|
3
|
+
> **Part of the [`igniteui-angular-grids`](../SKILL.md) skill hub.**
|
|
4
|
+
> For grid import patterns and `viewChild` access — see [`data-operations.md`](./data-operations.md).
|
|
5
|
+
> For Tree Grid / Hierarchical Grid / Pivot Grid / Grid Lite setup — see [`types.md`](./types.md).
|
|
6
|
+
> For paging and remote data — see [`paging-remote.md`](./paging-remote.md).
|
|
7
|
+
|
|
8
|
+
## State Persistence
|
|
9
|
+
|
|
10
|
+
> **Docs:** [State Persistence](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/state-persistence) (substitute URL prefix per grid type)
|
|
11
|
+
|
|
12
|
+
### Saving and Restoring Grid State
|
|
13
|
+
|
|
14
|
+
Use `IgxGridStateDirective` to persist sorting, filtering, grouping, paging, selection, and column state:
|
|
15
|
+
|
|
16
|
+
```html
|
|
17
|
+
<igx-grid #grid [data]="data()" igxGridState>
|
|
18
|
+
<igx-column field="name" [sortable]="true" [filterable]="true" [groupable]="true"></igx-column>
|
|
19
|
+
</igx-grid>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { IgxGridStateDirective } from 'igniteui-angular/grids/grid';
|
|
24
|
+
|
|
25
|
+
export class StatefulGridComponent {
|
|
26
|
+
gridState = viewChild.required(IgxGridStateDirective);
|
|
27
|
+
|
|
28
|
+
saveState() {
|
|
29
|
+
const state = this.gridState().getState();
|
|
30
|
+
localStorage.setItem('gridState', state);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
restoreState() {
|
|
34
|
+
const state = localStorage.getItem('gridState');
|
|
35
|
+
if (state) {
|
|
36
|
+
this.gridState().setState(state);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Selective State Features
|
|
43
|
+
|
|
44
|
+
Control which features are persisted:
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<igx-grid #grid [data]="data()" [igxGridState]="stateOptions">
|
|
48
|
+
</igx-grid>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
stateOptions = {
|
|
53
|
+
sorting: true,
|
|
54
|
+
filtering: true,
|
|
55
|
+
groupBy: true,
|
|
56
|
+
paging: true,
|
|
57
|
+
columns: true,
|
|
58
|
+
cellSelection: false, // skip selection state
|
|
59
|
+
rowSelection: false,
|
|
60
|
+
columnSelection: false,
|
|
61
|
+
advancedFiltering: true,
|
|
62
|
+
rowPinning: true,
|
|
63
|
+
expansion: true
|
|
64
|
+
};
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Restoring Custom Strategies
|
|
68
|
+
|
|
69
|
+
`IgxGridState` does **not** persist functions — this includes sorting strategies, filtering strategies, column formatters, summaries, `cellClasses`, and `cellStyles`. Use the `stateParsed` event to reapply these after restoring state:
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
restoreState() {
|
|
73
|
+
const stateJson = localStorage.getItem('gridState');
|
|
74
|
+
if (!stateJson) return;
|
|
75
|
+
|
|
76
|
+
// Subscribe to stateParsed to reapply custom strategies before state is applied
|
|
77
|
+
this.gridState().stateParsed.pipe(take(1)).subscribe(parsedState => {
|
|
78
|
+
parsedState.sorting?.forEach(expr => expr.strategy = NoopSortingStrategy.instance());
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
this.gridState().setState(stateJson);
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Restoring Column Templates
|
|
86
|
+
|
|
87
|
+
Column templates are also not serialized. Use the `columnInit` event to reassign them:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
@ViewChild('activeTemplate', { static: true }) public activeTemplate: TemplateRef<any>;
|
|
91
|
+
|
|
92
|
+
onColumnInit(column: IgxColumnComponent) {
|
|
93
|
+
if (column.field === 'IsActive') {
|
|
94
|
+
column.bodyTemplate = this.activeTemplate;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<igx-grid #grid [data]="data()" igxGridState (columnInit)="onColumnInit($event)">
|
|
101
|
+
<ng-template #activeTemplate igxCell let-val="val">
|
|
102
|
+
<igx-checkbox [checked]="val"></igx-checkbox>
|
|
103
|
+
</ng-template>
|
|
104
|
+
</igx-grid>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Tree Grid Data Operations
|
|
108
|
+
|
|
109
|
+
> **Docs:** [Tree Grid](https://www.infragistics.com/products/ignite-ui-angular/angular/components/treegrid/tree-grid) · [Load on Demand](https://www.infragistics.com/products/ignite-ui-angular/angular/components/treegrid/load-on-demand)
|
|
110
|
+
|
|
111
|
+
### Recursive Filtering Behavior
|
|
112
|
+
|
|
113
|
+
Tree Grid filtering is **inclusive** — when a child matches, all its ancestors are kept visible (marked as `isFilteredOutParent`) and auto-expanded. This is the default `TreeGridFilteringStrategy`.
|
|
114
|
+
|
|
115
|
+
```html
|
|
116
|
+
<igx-tree-grid #treeGrid
|
|
117
|
+
[data]="employees()"
|
|
118
|
+
[primaryKey]="'id'"
|
|
119
|
+
[foreignKey]="'managerId'"
|
|
120
|
+
[allowFiltering]="true"
|
|
121
|
+
[filterMode]="'excelStyleFilter'"
|
|
122
|
+
height="600px">
|
|
123
|
+
<igx-column field="name" [filterable]="true" [sortable]="true"></igx-column>
|
|
124
|
+
<igx-column field="title" [filterable]="true"></igx-column>
|
|
125
|
+
</igx-tree-grid>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
When you filter for `title = 'Developer'`, all ancestor rows are shown even though they don't match, and they're auto-expanded so you can see the matching children in context.
|
|
129
|
+
|
|
130
|
+
### Per-Level Sorting
|
|
131
|
+
|
|
132
|
+
Tree Grid sorting is applied **within each parent level** — children are sorted among siblings, not globally flattened:
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
// This sorts employees within their respective manager, not globally
|
|
136
|
+
this.treeGridRef().sort({ fieldName: 'name', dir: SortingDirection.Asc, ignoreCase: true });
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Tree Grid Batch Editing
|
|
140
|
+
|
|
141
|
+
Tree Grid uses `HierarchicalTransactionService` — each transaction carries a `path` array tracing the parent hierarchy, enabling proper undo/redo of nested changes:
|
|
142
|
+
|
|
143
|
+
```html
|
|
144
|
+
<igx-tree-grid #treeGrid
|
|
145
|
+
[data]="employees()"
|
|
146
|
+
[primaryKey]="'id'"
|
|
147
|
+
[foreignKey]="'managerId'"
|
|
148
|
+
[batchEditing]="true"
|
|
149
|
+
[rowEditable]="true"
|
|
150
|
+
height="600px">
|
|
151
|
+
<igx-column field="name" [editable]="true"></igx-column>
|
|
152
|
+
</igx-tree-grid>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
// Add a row as child of a specific parent
|
|
157
|
+
this.treeGridRef().addRow({ id: 100, name: 'New Employee', managerId: 2 }, 2);
|
|
158
|
+
|
|
159
|
+
// Cascade delete — deleting a parent removes all descendants (default behavior)
|
|
160
|
+
this.treeGridRef().deleteRow(2); // deletes row 2 and all its children
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Hierarchical Grid Data Operations
|
|
164
|
+
|
|
165
|
+
> **Docs:** [Hierarchical Grid](https://www.infragistics.com/products/ignite-ui-angular/angular/components/hierarchicalgrid/hierarchical-grid) · [Load on Demand](https://www.infragistics.com/products/ignite-ui-angular/angular/components/hierarchicalgrid/load-on-demand)
|
|
166
|
+
|
|
167
|
+
### Independent Grid Levels
|
|
168
|
+
|
|
169
|
+
Each level of a hierarchical grid has its **own independent** sorting, filtering, and paging state. Configure features on the `<igx-row-island>` blueprint:
|
|
170
|
+
|
|
171
|
+
```html
|
|
172
|
+
<igx-hierarchical-grid #hGrid
|
|
173
|
+
[data]="companies()"
|
|
174
|
+
[primaryKey]="'id'"
|
|
175
|
+
[allowFiltering]="true"
|
|
176
|
+
[filterMode]="'excelStyleFilter'"
|
|
177
|
+
height="600px">
|
|
178
|
+
|
|
179
|
+
<igx-column field="name" [sortable]="true" [filterable]="true"></igx-column>
|
|
180
|
+
|
|
181
|
+
<!-- Each row island defines column/feature config for that level -->
|
|
182
|
+
<igx-row-island [key]="'orders'" [primaryKey]="'orderId'" [allowFiltering]="true" [rowEditable]="true">
|
|
183
|
+
<igx-column field="orderId" [sortable]="true" [filterable]="true"></igx-column>
|
|
184
|
+
<igx-column field="amount" dataType="number" [editable]="true"></igx-column>
|
|
185
|
+
|
|
186
|
+
<igx-paginator [perPage]="10"></igx-paginator>
|
|
187
|
+
</igx-row-island>
|
|
188
|
+
</igx-hierarchical-grid>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Accessing Child Grid Instances
|
|
192
|
+
|
|
193
|
+
To perform programmatic operations on child grids, use the `(gridCreated)` event:
|
|
194
|
+
|
|
195
|
+
```typescript
|
|
196
|
+
onChildGridCreated(event: IGridCreatedEventArgs) {
|
|
197
|
+
const childGrid = event.grid;
|
|
198
|
+
// Example: apply a default sort to all child grids
|
|
199
|
+
childGrid.sort({ fieldName: 'orderId', dir: SortingDirection.Desc, ignoreCase: false });
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
```html
|
|
204
|
+
<igx-row-island [key]="'orders'" (gridCreated)="onChildGridCreated($event)">
|
|
205
|
+
<igx-column field="orderId" [sortable]="true"></igx-column>
|
|
206
|
+
</igx-row-island>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Batch Editing Propagation
|
|
210
|
+
|
|
211
|
+
Setting `[batchEditing]="true"` on the root hierarchical grid automatically propagates to all child grids:
|
|
212
|
+
|
|
213
|
+
```html
|
|
214
|
+
<igx-hierarchical-grid #hGrid
|
|
215
|
+
[data]="companies()"
|
|
216
|
+
[primaryKey]="'id'"
|
|
217
|
+
[batchEditing]="true"
|
|
218
|
+
[rowEditable]="true">
|
|
219
|
+
<!-- All child grids inherit batchEditing automatically -->
|
|
220
|
+
<igx-row-island [key]="'departments'" [primaryKey]="'deptId'" [rowEditable]="true">
|
|
221
|
+
<igx-column field="name" [editable]="true"></igx-column>
|
|
222
|
+
</igx-row-island>
|
|
223
|
+
</igx-hierarchical-grid>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
> **NOTE**: Each child grid instance has its **own** `TransactionService`. Commits must be done per grid instance.
|
|
227
|
+
|
|
228
|
+
## Pivot Grid Data Operations
|
|
229
|
+
|
|
230
|
+
> **Docs:** [Pivot Grid](https://www.infragistics.com/products/ignite-ui-angular/angular/components/pivotGrid/pivot-grid)
|
|
231
|
+
|
|
232
|
+
> **IMPORTANT**: The Pivot Grid does NOT use standard sorting, filtering, editing, or paging APIs. All data operations are controlled through `pivotConfiguration`.
|
|
233
|
+
|
|
234
|
+
### Dimension-Based Filtering
|
|
235
|
+
|
|
236
|
+
```typescript
|
|
237
|
+
import { FilteringExpressionsTree, FilteringLogic, IgxStringFilteringOperand } from 'igniteui-angular/grids/core';
|
|
238
|
+
|
|
239
|
+
// Create a filter for a dimension
|
|
240
|
+
const regionFilter = new FilteringExpressionsTree(FilteringLogic.Or);
|
|
241
|
+
regionFilter.filteringOperands = [
|
|
242
|
+
{
|
|
243
|
+
fieldName: 'Region',
|
|
244
|
+
condition: IgxStringFilteringOperand.instance().condition('equals'),
|
|
245
|
+
searchVal: 'North America'
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
fieldName: 'Region',
|
|
249
|
+
condition: IgxStringFilteringOperand.instance().condition('equals'),
|
|
250
|
+
searchVal: 'Europe'
|
|
251
|
+
}
|
|
252
|
+
];
|
|
253
|
+
|
|
254
|
+
// Apply the filter to a dimension
|
|
255
|
+
this.pivotConfig.filters[0].filter = regionFilter;
|
|
256
|
+
// Notify the grid of the change
|
|
257
|
+
this.pivotGridRef().pipeTrigger++;
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### Dimension-Based Sorting
|
|
261
|
+
|
|
262
|
+
```typescript
|
|
263
|
+
// Sort a row dimension
|
|
264
|
+
this.pivotConfig.rows[0].sortDirection = SortingDirection.Desc;
|
|
265
|
+
this.pivotGridRef().pipeTrigger++;
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Key Pivot Grid Limitations
|
|
269
|
+
|
|
270
|
+
- No cell/row editing, batch editing, or row adding
|
|
271
|
+
- No paging
|
|
272
|
+
- No column pinning, moving, or hiding (columns are auto-generated)
|
|
273
|
+
- No row dragging
|
|
274
|
+
- No standard filtering (`allowFiltering` is forced to `false`)
|
|
275
|
+
- No GroupBy (grouping is inherent via dimensions)
|
|
276
|
+
- State persistence serializes the full `pivotConfiguration`
|
|
277
|
+
|
|
278
|
+
## Grid Lite Data Operations
|
|
279
|
+
|
|
280
|
+
**Grid Lite** is a lightweight, open-source (MIT licensed) Web Component grid with an Angular wrapper. It supports **sorting and filtering only** — no editing, grouping, paging, summaries, selection, or export. Its API is **different from** the Flat/Tree/Hierarchical Grid APIs.
|
|
281
|
+
|
|
282
|
+
> **IMPORTANT**: Grid Lite uses `IgxGridLiteSortingExpression` and `IgxGridLiteFilteringExpression` — NOT `ISortingExpression` or `FilteringExpressionsTree` from the enterprise grids.
|
|
283
|
+
|
|
284
|
+
### Grid Lite Sorting
|
|
285
|
+
|
|
286
|
+
```typescript
|
|
287
|
+
import {
|
|
288
|
+
IgxGridLiteComponent,
|
|
289
|
+
IgxGridLiteSortingExpression,
|
|
290
|
+
IgxGridLiteSortingOptions
|
|
291
|
+
} from 'igniteui-angular/grids/lite';
|
|
292
|
+
|
|
293
|
+
@Component({
|
|
294
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
295
|
+
// ...
|
|
296
|
+
})
|
|
297
|
+
export class GridLiteSortExample {
|
|
298
|
+
gridRef = viewChild<IgxGridLiteComponent<Product>>('grid');
|
|
299
|
+
|
|
300
|
+
// Sorting options: mode can be 'single' or 'multiple'
|
|
301
|
+
sortingOptions: IgxGridLiteSortingOptions = { mode: 'multiple' };
|
|
302
|
+
|
|
303
|
+
// Initial sort state
|
|
304
|
+
sortExprs: IgxGridLiteSortingExpression[] = [
|
|
305
|
+
{ key: 'name', direction: 'ascending' }
|
|
306
|
+
];
|
|
307
|
+
|
|
308
|
+
sortByPrice() {
|
|
309
|
+
// Sort programmatically (single expression or array)
|
|
310
|
+
this.gridRef().sort({ key: 'price', direction: 'descending' });
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
clearAllSorts() {
|
|
314
|
+
this.gridRef().clearSort(); // clear all
|
|
315
|
+
// or: this.gridRef().clearSort('price'); // clear specific column
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
```html
|
|
321
|
+
<igx-grid-lite #grid
|
|
322
|
+
[data]="data"
|
|
323
|
+
[sortingOptions]="sortingOptions"
|
|
324
|
+
[(sortingExpressions)]="sortExprs"
|
|
325
|
+
(sorting)="onSorting($event)"
|
|
326
|
+
(sorted)="onSorted($event)">
|
|
327
|
+
<igx-grid-lite-column field="name" header="Name" sortable></igx-grid-lite-column>
|
|
328
|
+
<igx-grid-lite-column field="price" header="Price" dataType="number" sortable></igx-grid-lite-column>
|
|
329
|
+
</igx-grid-lite>
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
Sort expression shape: `{ key: string, direction: 'ascending' | 'descending' | 'none' }`
|
|
333
|
+
|
|
334
|
+
Sorting modes:
|
|
335
|
+
- `'single'` — only one column sorted at a time
|
|
336
|
+
- `'multiple'` — multi-column sorting
|
|
337
|
+
- `triState: true` — allows cycling through ascending → descending → none
|
|
338
|
+
|
|
339
|
+
### Grid Lite Filtering
|
|
340
|
+
|
|
341
|
+
```typescript
|
|
342
|
+
import {
|
|
343
|
+
IgxGridLiteComponent,
|
|
344
|
+
IgxGridLiteFilteringExpression
|
|
345
|
+
} from 'igniteui-angular/grids/lite';
|
|
346
|
+
|
|
347
|
+
// Filter expression shape
|
|
348
|
+
const filters: IgxGridLiteFilteringExpression[] = [
|
|
349
|
+
{ key: 'price', condition: 'greaterThan', searchTerm: 100 },
|
|
350
|
+
{ key: 'name', condition: 'contains', searchTerm: 'Widget' }
|
|
351
|
+
];
|
|
352
|
+
|
|
353
|
+
// Programmatic filtering
|
|
354
|
+
this.gridRef().filter({ key: 'price', condition: 'greaterThan', searchTerm: 100 });
|
|
355
|
+
this.gridRef().clearFilter('price');
|
|
356
|
+
this.gridRef().clearFilter(); // clear all
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
```html
|
|
360
|
+
<igx-grid-lite #grid
|
|
361
|
+
[data]="data"
|
|
362
|
+
[(filteringExpressions)]="filterExprs"
|
|
363
|
+
(filtering)="onFiltering($event)"
|
|
364
|
+
(filtered)="onFiltered($event)">
|
|
365
|
+
<igx-grid-lite-column field="name" header="Name" filterable></igx-grid-lite-column>
|
|
366
|
+
<igx-grid-lite-column field="price" header="Price" dataType="number" filterable></igx-grid-lite-column>
|
|
367
|
+
</igx-grid-lite>
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
Filter expression shape: `{ key: string, condition: string, searchTerm: any, criteria?: any[], caseSensitive?: boolean }`
|
|
371
|
+
|
|
372
|
+
Filter conditions depend on `dataType`:
|
|
373
|
+
- **string**: `contains`, `startsWith`, `endsWith`, `equals`, `doesNotContain`, `doesNotEqual`, `empty`, `notEmpty`, `null`, `notNull`
|
|
374
|
+
- **number**: `equals`, `doesNotEqual`, `greaterThan`, `lessThan`, `greaterThanOrEqualTo`, `lessThanOrEqualTo`, `empty`, `notEmpty`, `null`, `notNull`
|
|
375
|
+
- **boolean**: `all`, `true`, `false`, `empty`, `notEmpty`, `null`, `notNull`
|
|
376
|
+
- **date**: `equals`, `doesNotEqual`, `before`, `after`, `today`, `yesterday`, `thisMonth`, `lastMonth`, `nextMonth`, `thisYear`, `lastYear`, `nextYear`, `empty`, `notEmpty`, `null`, `notNull`
|
|
377
|
+
|
|
378
|
+
### Grid Lite Remote Data Operations
|
|
379
|
+
|
|
380
|
+
Grid Lite uses `dataPipelineConfiguration` — a callback-based approach (NOT noop strategies):
|
|
381
|
+
|
|
382
|
+
```typescript
|
|
383
|
+
import { IgxGridLiteDataPipelineConfiguration } from 'igniteui-angular/grids/lite';
|
|
384
|
+
|
|
385
|
+
dataPipeline: IgxGridLiteDataPipelineConfiguration<Product> = {
|
|
386
|
+
sort: async (params) => {
|
|
387
|
+
// params.grid — the grid instance
|
|
388
|
+
// params.data — current data array
|
|
389
|
+
// params.type — 'sort'
|
|
390
|
+
const result = await fetch(`/api/products?sort=${JSON.stringify(params.grid.sortingExpressions)}`);
|
|
391
|
+
return await result.json();
|
|
392
|
+
},
|
|
393
|
+
filter: async (params) => {
|
|
394
|
+
const result = await fetch(`/api/products?filter=${JSON.stringify(params.grid.filteringExpressions)}`);
|
|
395
|
+
return await result.json();
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
```html
|
|
401
|
+
<igx-grid-lite #grid
|
|
402
|
+
[data]="data"
|
|
403
|
+
[dataPipelineConfiguration]="dataPipeline">
|
|
404
|
+
</igx-grid-lite>
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
Callbacks can be synchronous (return `T[]`) or asynchronous (return `Promise<T[]>`). When a `dataPipelineConfiguration` callback is provided for a given operation, the client-side pipeline for that operation is bypassed entirely.
|
|
408
|
+
|
|
409
|
+
### Grid Lite Events
|
|
410
|
+
|
|
411
|
+
| Event | Cancelable | Payload |
|
|
412
|
+
|---|---|---|
|
|
413
|
+
| `(sorting)` | Yes (`event.detail.cancel = true`) | Sorting expression about to be applied |
|
|
414
|
+
| `(sorted)` | No | Sorting completed |
|
|
415
|
+
| `(filtering)` | Yes (`event.detail.cancel = true`) | Filter expression about to be applied |
|
|
416
|
+
| `(filtered)` | No | Filtering completed |
|
|
417
|
+
|
|
418
|
+
### Grid Lite Limitations (No Data Operations)
|
|
419
|
+
|
|
420
|
+
These data operations are **NOT available** in Grid Lite:
|
|
421
|
+
- Editing (cell, row, batch) — no `[editable]`, no `beginEdit()`, no transactions
|
|
422
|
+
- Grouping — no `groupBy()`, no `IgxGroupByRow`
|
|
423
|
+
- Paging — no `IgxPaginatorComponent`
|
|
424
|
+
- Summaries — no `IgxSummaryOperand`
|
|
425
|
+
- Selection — no `rowSelection`, `cellSelection`, or `columnSelection`
|
|
426
|
+
- State persistence — no `IgxGridStateDirective`
|
|
427
|
+
- Export — no `IgxExcelExporterService` or `IgxCsvExporterService`
|
|
428
|
+
- Advanced filtering — no `advancedFilteringExpressionsTree`
|
|
429
|
+
|
|
430
|
+
## Key Rules
|
|
431
|
+
|
|
432
|
+
1. **State persistence** — use `IgxGridStateDirective` to save/restore sort, filter, group, and column configuration; functions (formatters, strategies, summaries) must be reapplied via `stateParsed` event
|
|
433
|
+
2. **Tree Grid filtering is recursive** — parents of matching children are always shown and auto-expanded
|
|
434
|
+
3. **Hierarchical Grid levels are independent** — sorting/filtering/paging don't cascade; configure on `<igx-row-island>`
|
|
435
|
+
4. **Pivot Grid is read-only** — no editing, paging, or standard filtering/sorting; use `pivotConfiguration` for all data operations
|
|
436
|
+
5. **Grid Lite has its own API** — uses `IgxGridLiteSortingExpression`/`IgxGridLiteFilteringExpression` (NOT `ISortingExpression`/`FilteringExpressionsTree`), `dataPipelineConfiguration` for remote ops (NOT noop strategies), and has no editing, grouping, paging, summaries, or selection
|
|
437
|
+
6. **Use the correct component type for `viewChild`** — `IgxGridLiteComponent`, `IgxGridComponent`, `IgxTreeGridComponent`, `IgxHierarchicalGridComponent`, or `IgxPivotGridComponent`
|
|
438
|
+
7. **Import the correct directives/components** — `IGX_GRID_DIRECTIVES`, `IGX_TREE_GRID_DIRECTIVES`, `IGX_HIERARCHICAL_GRID_DIRECTIVES`, `IGX_PIVOT_GRID_DIRECTIVES`, or individual Grid Lite imports (with `CUSTOM_ELEMENTS_SCHEMA`)
|
|
439
|
+
8. **Use signals for data** — `[data]="myData()"` with `signal<T[]>([])`
|
|
440
|
+
|
|
441
|
+
## See Also
|
|
442
|
+
|
|
443
|
+
- [`data-operations.md`](./data-operations.md) — Sorting, filtering, grouping, and canonical grid import patterns
|
|
444
|
+
- [`paging-remote.md`](./paging-remote.md) — Paging, remote data operations, virtualization
|
|
445
|
+
- [`editing.md`](./editing.md) — Cell editing, row editing, batch editing, validation, summaries
|
|
446
|
+
- [`structure.md`](./structure.md) — Grid structure, column configuration, templates, layout, selection
|
|
447
|
+
- [`../../igniteui-angular-components/SKILL.md`](../../igniteui-angular-components/SKILL.md) — Non-grid Ignite UI components
|
|
448
|
+
- [`../../igniteui-angular-theming/SKILL.md`](../../igniteui-angular-theming/SKILL.md) — Theming & Styling
|