Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion projects/igniteui-angular/grids/core/src/grid-public-row.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,12 @@ abstract class BaseRow implements RowType {
return false;
}

/**
* Gets whether the row is disabled.
* A disabled row represents a ghost placeholder created by row pinning.
*/
public get disabled(): boolean {
return this.grid.isGhostRecord(this.data);
return this.grid.isGhostRecordAtIndex(this.index);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7871,8 +7871,10 @@ export abstract class IgxGridBaseDirective implements GridType,
* If record is pinned but is not in pinned area then it is a ghost record.
*
* @param dataViewIndex The index of that record in the data view.
* @hidden
* @internal
*/
private isGhostRecordAtIndex(dataViewIndex) {
public isGhostRecordAtIndex(dataViewIndex) {
const isPinned = this.isRecordPinned(this.dataView[dataViewIndex]);
const isInPinnedArea = this.isRecordPinnedByViewIndex(dataViewIndex);
return isPinned && !isInPinnedArea;
Expand Down
12 changes: 12 additions & 0 deletions projects/igniteui-angular/grids/grid/src/grid-row-pinning.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,18 @@ describe('Row Pinning #grid', () => {
expect(grid.gridAPI.get_row_by_index(1).key).toBe(fix.componentInstance.data[1]);
});

it('should mark ghost placeholder rows as disabled in RowType API.', () => {
grid.pinRow(fix.componentInstance.data[0]);
fix.detectChanges();

const renderedRow = grid.rowList.toArray().find(r => r.index === 1);
const rowType = grid.getRowByIndex(1);

expect(renderedRow).toBeDefined();
expect(renderedRow.disabled).toBeTrue();
expect(rowType.disabled).toBeTrue();
});

it('should search in both pinned and unpinned rows.', () => {
// pin 1st row
let row = grid.gridAPI.get_row_by_index(0);
Expand Down
Loading