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
14 changes: 9 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

All notable changes for each version of this project will be documented in this file.
## 11.1.0
### General
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
- The following new events are introduced: `sorting`, `filtering`, `columnPinned`, `columnVisibilityChanging`.
- **Behavioral Change** -
- `onColumnPinning` to emit `IPinColumnCancellableEventArgs` instead of `IPinColumnEventArgs`.

### New Features
- `IgxDropDown`
- The `igx-drop-down-item` now allows for `igxPrefix`, `igxSuffix` and `igx-divider` directives to be passed as `ng-content` and they will be renderer accordingly in the item's content.
- `IgxGrid`
- Added support for exporting grouped data.
- `IgxPaginator`
- `paging` and `pagingDone` events are now emitted.
- `IgxInput` now supports `type="file"` and its styling upon all themes.
_Note: validation of file type input is not yet supported._

Expand Down Expand Up @@ -57,6 +54,13 @@ All notable changes for each version of this project will be documented in this
- `IgxGrid`, `IgxHierarchicalGrid`, `IgxTreeGrid`
- Added new property `selectRowOnClick` that determines whether clicking over a row will change its selection state or not. Set to `true` by default.
- `GridPagingMode` enum members rename - `local` to `Local` and `remote` to `Remote`. Example: `GridPagingMode.Local`.
- The following new events are introduced: `sorting`, `filtering`, `columnPinned`, `columnVisibilityChanging`.
- **Behavioral Change** -
- `onColumnPinning` to emit `IPinColumnCancellableEventArgs` instead of `IPinColumnEventArgs`.
- **Breaking Change**:
- `onPagingDone` output is removed. Use the `paging` and `pagingDone` outputs exposed by the `IgxPaginator`.
- `page`, `perPage`, `paginate`, `nextPage`, `previousPage` and `totalPages` in the grids are deprecated and will be removed. Use the corresponding `IgxPaginator` outputs/inputs. When using an external paginator, take care to provide the corresponding slice of data. See [`Paging with Custom Template`](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/paging#remote-paging-with-custom-template)


## 11.0.4

Expand Down
8 changes: 0 additions & 8 deletions projects/igniteui-angular/src/lib/grids/common/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,6 @@ export interface IPinColumnEventArgs extends IBaseEventArgs {
export interface IPinColumnCancellableEventArgs extends IPinColumnEventArgs, CancelableEventArgs {
}

/**
* The event arguments after a page is changed.
*/
export interface IPageEventArgs extends IBaseEventArgs {
previous: number;
current: number;
}

export interface IRowDataEventArgs extends IBaseEventArgs {
data: any;
}
Expand Down
143 changes: 75 additions & 68 deletions projects/igniteui-angular/src/lib/grids/grid-base.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ import {
IRowSelectionEventArgs,
IPinColumnEventArgs,
IGridEditEventArgs,
IPageEventArgs,
IRowDataEventArgs,
IColumnResizeEventArgs,
IColumnMovingStartEventArgs,
Expand All @@ -140,8 +139,7 @@ import {
IFilteringEventArgs,
IColumnVisibilityChangedEventArgs,
IColumnVisibilityChangingEventArgs,
IPinColumnCancellableEventArgs,
IColumnResizingEventArgs
IPinColumnCancellableEventArgs
} from './common/events';
import { IgxAdvancedFilteringDialogComponent } from './filtering/advanced-filtering/advanced-filtering-dialog.component';
import { GridType } from './common/grid.interface';
Expand Down Expand Up @@ -292,6 +290,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
public onScroll = new EventEmitter<IGridScrollEventArgs>();

/**
* @deprecated Use `IgxPaginator` corresponding output instead.
* Emitted after the current page is changed.
*
* @example
Expand All @@ -304,10 +303,12 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
* }
* ```
*/
@DeprecateProperty('Use the corresponding output exposed by the `igx-paginator`.')
@Output()
public pageChange = new EventEmitter<number>();

/**
* @deprecated Use `IgxPaginator` corresponding output instead.
* Emitted when `perPage` property value of the grid is changed.
*
* @example
Expand All @@ -320,6 +321,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
* }
* ```
*/
@DeprecateProperty('Use the corresponding output exposed by the `igx-paginator`.')
@Output()
public perPageChange = new EventEmitter<number>();

Expand Down Expand Up @@ -669,19 +671,6 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
@Output()
public onFilteringDone = new EventEmitter<IFilteringExpressionsTree>();

/**
* Emitted after paging is performed.
*
* @remarks
* Returns an object consisting of the previous and next pages.
* @example
* ```html
* <igx-grid #grid [data]="localData" [height]="'305px'" [autoGenerate]="true" (onPagingDone)="pagingDone($event)"></igx-grid>
* ```
*/
@Output()
public onPagingDone = new EventEmitter<IPageEventArgs>();

/**
* Emitted when a row added through the API.
*
Expand Down Expand Up @@ -1432,6 +1421,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
}

/**
* @deprecated Use `IgxPaginator` corresponding method instead.
* Gets/Sets the current page index.
*
* @example
Expand All @@ -1441,6 +1431,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
* @remarks
* Supports two-way binding.
*/
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
@Input()
public get page(): number {
return this._page;
Expand All @@ -1451,14 +1442,14 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
return;
}
this.selectionService.clear(true);
this.onPagingDone.emit({ previous: this._page, current: val });
this._page = val;
this.pageChange.emit(this._page);
this.navigateTo(0);
this.notifyChanges();
}

/**
* @deprecated Use `IgxPaginator` corresponding method instead.
* Gets/Sets the number of visible items per page.
*
* @remarks
Expand All @@ -1468,6 +1459,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
* <igx-grid #grid [data]="Data" [paging]="true" [(perPage)]="model.perPage" [autoGenerate]="true"></igx-grid>
* ```
*/
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
@Input()
public get perPage(): number {
return this._perPage;
Expand All @@ -1480,7 +1472,9 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
this.selectionService.clear(true);
this._perPage = val;
this.perPageChange.emit(this._perPage);
this.page = 0;
if (this.totalPages !== 0 && this._page >= this.totalPages) {
this.page = this.totalPages - 1;
}
this.endEdit(true);
this.notifyChanges();
}
Expand Down Expand Up @@ -3070,6 +3064,57 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
this.cdr.detach();
}

/**
* @deprecated Use `IgxPaginator` corresponding method instead.
* Goes to the desired page index.
*
* @example
* ```typescript
* this.grid1.paginate(1);
* ```
* @param val
*/
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
public paginate(val: number): void {
if (val < 0 || val > this.totalPages - 1) {
return;
}

this.page = val;
}

/**
* @deprecated Use `IgxPaginator` corresponding method instead.
* Goes to the next page, if the grid is not already at the last page.
*
* @example
* ```typescript
* this.grid1.nextPage();
* ```
*/
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
public nextPage(): void {
if (!this.isLastPage) {
this.page += 1;
}
}

/**
* @deprecated Use `IgxPaginator` corresponding method instead.
* Goes to the previous page, if the grid is not already at the first page.
*
* @example
* ```typescript
* this.grid1.previousPage();
* ```
*/
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
public previousPage(): void {
if (!this.isFirstPage) {
this.page -= 1;
}
}

/**
* @hidden
* @internal
Expand Down Expand Up @@ -3288,11 +3333,6 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
this.zone.run(() => {
this.notifyChanges(true);
});
});

this.onPagingDone.pipe(destructor).subscribe(() => {
this.endEdit(true);
this.selectionService.clear(true);
});

this.onColumnMoving.pipe(destructor).subscribe(() => this.endEdit(true));
Expand Down Expand Up @@ -3370,6 +3410,12 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
});
}

/** @hidden @internal */
public _pagingDone() {
this.endEdit(true);
this.selectionService.clear(true);
}

/**
* @hidden
*/
Expand Down Expand Up @@ -4101,13 +4147,15 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
}

/**
* @deprecated Use `IgxPaginator` corresponding method instead.
* Gets the total number of pages.
*
* @example
* ```typescript
* const totalPages = this.grid.totalPages;
* ```
*/
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
public get totalPages(): number {
if (this.pagingState) {
return this.pagingState.metadata.countPages;
Expand All @@ -4116,45 +4164,19 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
}

/**
* @deprecated Use `IgxPaginator` corresponding method instead.
* Gets if the current page is the first page.
*
* @example
* ```typescript
* const firstPage = this.grid.isFirstPage;
* ```
*/
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
public get isFirstPage(): boolean {
return this.page === 0;
}

/**
* Goes to the next page, if the grid is not already at the last page.
*
* @example
* ```typescript
* this.grid1.nextPage();
* ```
*/
public nextPage(): void {
if (!this.isLastPage) {
this.page += 1;
}
}

/**
* Goes to the previous page, if the grid is not already at the first page.
*
* @example
* ```typescript
* this.grid1.previousPage();
* ```
*/
public previousPage(): void {
if (!this.isFirstPage) {
this.page -= 1;
}
}

/**
* Returns the total number of records.
*
Expand All @@ -4179,13 +4201,15 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
}

/**
* @deprecated Use `IgxPaginator` corresponding method instead.
* Returns if the current page is the last page.
*
* @example
* ```typescript
* const lastPage = this.grid.isLastPage;
* ```
*/
@DeprecateProperty('Use the corresponding method exposed by the `igx-paginator`.')
public get isLastPage(): boolean {
return this.page + 1 >= this.totalPages;
}
Expand Down Expand Up @@ -4284,23 +4308,6 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
this._columnsReordered(column, target);
}

/**
* Goes to the desired page index.
*
* @example
* ```typescript
* this.grid1.paginate(1);
* ```
* @param val
*/
public paginate(val: number): void {
if (val < 0 || val > this.totalPages - 1) {
return;
}

this.page = val;
}

/**
* Manually marks the `IgxGridComponent` for change detection.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,7 @@ describe('IgxGrid - Row Selection #grid', () => {

const secondRow = grid.getRowByIndex(1);
grid.onHeaderSelectorClick(UIInteractions.getMouseEvent('click'));
tick();
fix.detectChanges();

GridSelectionFunctions.verifyHeaderRowCheckboxState(fix, true);
Expand All @@ -1526,6 +1527,7 @@ describe('IgxGrid - Row Selection #grid', () => {

// Click on a single row
secondRow.onClick(UIInteractions.getMouseEvent('click'));
tick();
fix.detectChanges();

GridSelectionFunctions.verifyHeaderRowCheckboxState(fix, false, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
</div>

<ng-template #defaultPaginator>
<igx-paginator [overlaySettings]="paginatorSettings" [displayDensity]="displayDensity" [(page)]="page" [totalRecords]="totalRecords" [(perPage)]="perPage">
<igx-paginator [overlaySettings]="paginatorSettings" [displayDensity]="displayDensity" [(page)]="page" [totalRecords]="totalRecords" [(perPage)]="perPage" (pagingDone)="_pagingDone()">
</igx-paginator>
</ng-template>

Expand Down
Loading