Skip to content

Commit 5fce619

Browse files
authored
Merge branch 'master' into dkamburov/docs-calendar
2 parents 78ddcbe + 2172095 commit 5fce619

File tree

5 files changed

+22
-13
lines changed

5 files changed

+22
-13
lines changed

projects/igniteui-angular/src/lib/grids/cell.component.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { ColumnType } from './common/column.interface';
2828
import { RowType } from './common/row.interface';
2929
import { GridSelectionMode } from './common/enums';
3030
import { GridType } from './common/grid.interface';
31-
import { IgxGridComponent } from './grid';
31+
import { IgxGridComponent, ISearchInfo } from './grid';
3232

3333
/**
3434
* Providing reference to `IgxGridCellComponent`:
@@ -51,6 +51,7 @@ import { IgxGridComponent } from './grid';
5151
})
5252
export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
5353
private _vIndex = -1;
54+
protected _lastSearchInfo: ISearchInfo;
5455

5556
/**
5657
* Gets the column of the cell.
@@ -302,6 +303,16 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
302303
return this._cellSelection;
303304
}
304305

306+
/**
307+
* @hidden
308+
* @internal
309+
*/
310+
@Input()
311+
set lastSearchInfo(value: ISearchInfo) {
312+
this._lastSearchInfo = value;
313+
this.highlightText(this._lastSearchInfo.searchText, this._lastSearchInfo.caseSensitive, this._lastSearchInfo.exactMatch);
314+
}
315+
305316
set cellSelectionMode(value) {
306317
if (this._cellSelection === value) { return; }
307318
this.zone.runOutsideAngular(() => {

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6070,18 +6070,6 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
60706070
* @hidden
60716071
*/
60726072
public cachedViewLoaded(args: ICachedViewLoadedEventArgs) {
6073-
if (args.context['templateID'] === 'dataRow' && args.context['$implicit'] === args.oldContext['$implicit']) {
6074-
args.view.detectChanges();
6075-
const row = this.getRowByIndex(args.context.index);
6076-
if (row && row.cells) {
6077-
row.cells.forEach((c) => {
6078-
c.highlightText(
6079-
this.lastSearchInfo.searchText,
6080-
this.lastSearchInfo.caseSensitive,
6081-
this.lastSearchInfo.exactMatch);
6082-
});
6083-
}
6084-
}
60856073
if (this.hasHorizontalScroll()) {
60866074
const tmplId = args.context.templateID;
60876075
const index = args.context.index;

projects/igniteui-angular/src/lib/grids/grid/grid-row.component.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
[visibleColumnIndex]="col.visibleIndex"
9191
[value]="rowData[col.field]"
9292
[cellTemplate]="col.bodyTemplate"
93+
[lastSearchInfo]="grid.lastSearchInfo"
9394
[cellSelectionMode]="grid.cellSelection" #cell>
9495
</igx-grid-cell>
9596
</ng-template>
@@ -116,6 +117,7 @@
116117
[visibleColumnIndex]="col.visibleIndex"
117118
[value]="rowData[col.field]"
118119
[cellTemplate]="col.bodyTemplate"
120+
[lastSearchInfo]="grid.lastSearchInfo"
119121
[cellSelectionMode]="grid.cellSelection" #cell>
120122
</igx-expandable-grid-cell>
121123
</ng-template>
@@ -145,6 +147,7 @@
145147
[visibleColumnIndex]="col.visibleIndex"
146148
[value]="rowData[col.field]"
147149
[cellTemplate]="col.bodyTemplate"
150+
[lastSearchInfo]="grid.lastSearchInfo"
148151
[cellSelectionMode]="grid.cellSelection" #cell>
149152
</igx-grid-cell>
150153
</ng-template>
@@ -175,6 +178,7 @@
175178
[visibleColumnIndex]="col.visibleIndex"
176179
[value]="rowData[col.field]"
177180
[cellTemplate]="col.bodyTemplate"
181+
[lastSearchInfo]="grid.lastSearchInfo"
178182
[cellSelectionMode]="grid.cellSelection" #cell>
179183
</igx-expandable-grid-cell>
180184
</ng-template>

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-row.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
[visibleColumnIndex]="col.visibleIndex"
5454
[value]="rowData[col.field]"
5555
[cellTemplate]="col.bodyTemplate"
56+
[lastSearchInfo]="grid.lastSearchInfo"
5657
[cellSelectionMode]="grid.cellSelection">
5758
</igx-hierarchical-grid-cell>
5859
</ng-container>
@@ -76,6 +77,7 @@
7677
[visibleColumnIndex]="col.visibleIndex"
7778
[value]="rowData[col.field]"
7879
[cellTemplate]="col.bodyTemplate"
80+
[lastSearchInfo]="grid.lastSearchInfo"
7981
[cellSelectionMode]="grid.cellSelection">
8082
</igx-hierarchical-grid-cell>
8183
</ng-template>

projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid-row.component.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
[visibleColumnIndex]="col.visibleIndex"
3434
[value]="rowData[col.field]"
3535
[cellTemplate]="col.bodyTemplate"
36+
[lastSearchInfo]="grid.lastSearchInfo"
3637
[cellSelectionMode]="grid.cellSelection" #treeCell>
3738
</igx-grid-cell>
3839
</ng-template>
@@ -60,6 +61,7 @@
6061
[value]="rowData[col.field]"
6162
[isLoading]="isLoading"
6263
[cellTemplate]="col.bodyTemplate"
64+
[lastSearchInfo]="grid.lastSearchInfo"
6365
[cellSelectionMode]="grid.cellSelection" #treeCell>
6466
</igx-tree-grid-cell>
6567
</ng-template>
@@ -86,6 +88,7 @@
8688
[visibleColumnIndex]="col.visibleIndex"
8789
[value]="rowData[col.field]"
8890
[cellTemplate]="col.bodyTemplate"
91+
[lastSearchInfo]="grid.lastSearchInfo"
8992
[cellSelectionMode]="grid.cellSelection" #treeCell>
9093
</igx-grid-cell>
9194
</ng-template>
@@ -112,6 +115,7 @@
112115
[value]="rowData[col.field]"
113116
[isLoading]="isLoading"
114117
[cellTemplate]="col.bodyTemplate"
118+
[lastSearchInfo]="grid.lastSearchInfo"
115119
[cellSelectionMode]="grid.cellSelection" #treeCell>
116120
</igx-tree-grid-cell>
117121
</ng-template>

0 commit comments

Comments
 (0)