Skip to content

Commit a6f2906

Browse files
committed
chore(*): Change names of the methods to check if a given row is pinned by idx
1 parent 4c73041 commit a6f2906

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
906906
*/
907907
public get searchMetadata() {
908908
const meta = new Map<string, any>();
909-
meta.set('pinned', this.grid.isRecordPinnedByIndex(this.row.index));
909+
meta.set('pinned', this.grid.isRecordPinnedByViewIndex(this.row.index));
910910
return meta;
911911
}
912912
}

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2723,19 +2723,27 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
27232723
}
27242724

27252725
/**
2726+
* Returns whether the record is pinned or not.
2727+
*
2728+
* @param rowIndex Index of the record in the `dataView` collection.
2729+
*
27262730
* @hidden
27272731
* @internal
27282732
*/
2729-
public isRecordPinnedByIndex(rowIndex: number) {
2733+
public isRecordPinnedByViewIndex(rowIndex: number) {
27302734
return this.hasPinnedRecords && (this.isRowPinningToTop && rowIndex < this.pinnedDataView.length) ||
27312735
(!this.isRowPinningToTop && rowIndex >= this.unpinnedDataView.length);
27322736
}
27332737

27342738
/**
2739+
* Returns whether the record is pinned or not.
2740+
*
2741+
* @param rowIndex Index of the record in the `filteredSortedData` collection.
2742+
*
27352743
* @hidden
27362744
* @internal
27372745
*/
2738-
public isFilteredSortedDataRecordPinnedByIndex(rowIndex: number) {
2746+
public isRecordPinnedByIndex(rowIndex: number) {
27392747
return this.hasPinnedRecords && (this.isRowPinningToTop && rowIndex < this._filteredSortedPinnedData.length) ||
27402748
(!this.isRowPinningToTop && rowIndex >= this._filteredSortedUnpinnedData.length);
27412749
}
@@ -6017,7 +6025,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
60176025
if (exactMatch) {
60186026
if (searchValue === searchText) {
60196027
const metadata = new Map<string, any>();
6020-
metadata.set('pinned', this.isFilteredSortedDataRecordPinnedByIndex(rowIndex));
6028+
metadata.set('pinned', this.isRecordPinnedByIndex(rowIndex));
60216029
this.lastSearchInfo.matchInfoCache.push({
60226030
row: dataRow,
60236031
column: c.field,
@@ -6031,7 +6039,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
60316039

60326040
while (searchIndex !== -1) {
60336041
const metadata = new Map<string, any>();
6034-
metadata.set('pinned', this.isFilteredSortedDataRecordPinnedByIndex(rowIndex));
6042+
metadata.set('pinned', this.isRecordPinnedByIndex(rowIndex));
60356043
this.lastSearchInfo.matchInfoCache.push({
60366044
row: dataRow,
60376045
column: c.field,

projects/igniteui-angular/src/lib/grids/grid-navigation.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ export class IgxGridNavigationService {
309309
}
310310

311311
public shouldPerformVerticalScroll(targetRowIndex: number, visibleColIndex: number): boolean {
312-
if (this.grid.isRecordPinnedByIndex(targetRowIndex)) { return false; }
312+
if (this.grid.isRecordPinnedByViewIndex(targetRowIndex)) { return false; }
313313
const scrollRowIndex = this.grid.hasPinnedRecords && this.grid.isRowPinningToTop ?
314314
targetRowIndex - this.grid.pinnedDataView.length : targetRowIndex;
315315
const targetRow = this.getRowElementByIndex(targetRowIndex);

0 commit comments

Comments
 (0)