Skip to content

Commit a91cb58

Browse files
committed
feat(igxTreeGrid): Fixes search with a pinned row #6640
1 parent e968ee3 commit a91cb58

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -5932,20 +5932,20 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
59325932
const datePipe = new IgxDatePipeComponent(this.locale);
59335933
data.forEach((dataRow) => {
59345934
const ghostRec = dataRow.ghostRec !== undefined;
5935-
const dataRowRec = { ...dataRow };
5936-
dataRow = ghostRec ? dataRow.recordData : dataRow;
5935+
let dataRowRec = { ...dataRow };
5936+
dataRowRec = ghostRec ? dataRowRec.recordData : dataRowRec;
59375937
columnItems.forEach((c) => {
5938-
const value = c.formatter ? c.formatter(dataRow[c.field]) :
5939-
c.dataType === 'number' ? numberPipe.transform(dataRow[c.field], this.locale) :
5940-
c.dataType === 'date' ? datePipe.transform(dataRow[c.field], this.locale)
5941-
: dataRow[c.field];
5938+
const value = c.formatter ? c.formatter(dataRowRec[c.field]) :
5939+
c.dataType === 'number' ? numberPipe.transform(dataRowRec[c.field], this.locale) :
5940+
c.dataType === 'date' ? datePipe.transform(dataRowRec[c.field], this.locale)
5941+
: dataRowRec[c.field];
59425942
if (value !== undefined && value !== null && c.searchable) {
59435943
let searchValue = caseSensitive ? String(value) : String(value).toLowerCase();
59445944

59455945
if (exactMatch) {
59465946
if (searchValue === searchText) {
59475947
this.lastSearchInfo.matchInfoCache.push({
5948-
row: dataRowRec,
5948+
row: dataRow,
59495949
column: c.field,
59505950
index: 0,
59515951
});
@@ -5956,7 +5956,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
59565956

59575957
while (searchIndex !== -1) {
59585958
this.lastSearchInfo.matchInfoCache.push({
5959-
row: dataRowRec,
5959+
row: dataRow,
59605960
column: c.field,
59615961
index: occurenceIndex++,
59625962
});

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
[formatter]="col.formatter"
2727
[row]="this"
2828
[style.min-height.px]="grid.rowHeight || 32"
29-
[rowData]="rowData"
29+
[rowData]="!!disabled ? treeRow.data : rowData"
3030
[style.min-width]="col.width"
3131
[style.max-width]="col.width"
3232
[style.flex-basis]="col.width"
@@ -98,7 +98,7 @@
9898
[firstPinned]="col.isFirstPinned"
9999
[lastPinned]="col.isLastPinned"
100100
[style.min-height.px]="grid.rowHeight || 32"
101-
[rowData]="rowData"
101+
[rowData]="!!disabled ? treeRow.data : rowData"
102102
[style.min-width]="col.width"
103103
[style.max-width]="col.width"
104104
[style.flex-basis]="col.width"

0 commit comments

Comments
 (0)