Skip to content

Commit 00400bb

Browse files
committed
chore(*): Fixes getSelectedData()
1 parent fd8883e commit 00400bb

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5150,6 +5150,17 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
51505150
return this.verticalScrollContainer.igxForOf;
51515151
}
51525152

5153+
/**
5154+
* Returns the currently transformed paged/filtered/sorted/grouped pinned data, displayed in the grid.
5155+
* @example
5156+
* ```typescript
5157+
* const pinnedDataView = this.grid.pinnedDataView;
5158+
* ```
5159+
*/
5160+
get pinnedDataView(): any[] {
5161+
return this.pinnedRows.map(row => row.rowData);
5162+
}
5163+
51535164
/**
51545165
* Get current selection state.
51555166
* @example
@@ -5391,7 +5402,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
53915402
* If `headers` is enabled, it will use the column header (if any) instead of the column field.
53925403
*/
53935404
public getSelectedData(formatters = false, headers = false) {
5394-
const source = this.dataView;
5405+
const source = this.isRowPinningToTop ? [...this.pinnedDataView, ...this.dataView] : [...this.dataView, ...this.pinnedDataView];
53955406
return this.extractDataFromSelection(source, formatters, headers);
53965407
}
53975408

0 commit comments

Comments
 (0)