Skip to content

Commit

Permalink
fix(grid): ColumnGroup should not be grouped #2944
Browse files Browse the repository at this point in the history
  • Loading branch information
nrobakova committed Nov 8, 2018
1 parent 9d636ed commit e8ae149
Show file tree
Hide file tree
Showing 6 changed files with 426 additions and 362 deletions.
2 changes: 1 addition & 1 deletion projects/igniteui-angular/src/lib/grids/grid.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export class IgxColumnMovingDragDirective extends IgxDragDirective {
}

get draggable(): boolean {
return this.column && (this.column.movable || this.column.groupable);
return this.column && (this.column.movable || (this.column.groupable && !this.column.columnGroup));
}

public get icon(): HTMLElement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ export class IgxGridComponent extends IgxGridBaseComponent implements OnInit, Do
* @memberof IgxGridComponent
*/
get hasGroupableColumns(): boolean {
return this.columnList.some((col) => col.groupable);
return this.columnList.some((col) => col.groupable && !col.columnGroup);
}

private _setGroupColsVisibility(value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class IgxGroupAreaDropDirective extends IgxDropDirective {
const column: IgxColumnComponent = drag.column;
const grid = <IgxGridComponent>column.grid;
const isGrouped = grid.groupingExpressions.findIndex((item) => item.fieldName === column.field) !== -1;
if (column.groupable && !isGrouped) {
if (column.groupable && !isGrouped && !column.columnGroup) {
drag.icon.innerText = 'group_work';
this.hovered = true;
} else {
Expand All @@ -58,7 +58,7 @@ export class IgxGroupAreaDropDirective extends IgxDropDirective {
const column: IgxColumnComponent = drag.column;
const grid = <IgxGridComponent>column.grid;
const isGrouped = grid.groupingExpressions.findIndex((item) => item.fieldName === column.field) !== -1;
if (column.groupable && !isGrouped) {
if (column.groupable && !isGrouped && !column.columnGroup) {
grid.groupBy({ fieldName: column.field, dir: SortingDirection.Asc, ignoreCase: column.sortingIgnoreCase,
strategy: column.sortStrategy });
}
Expand Down
Loading

0 comments on commit e8ae149

Please sign in to comment.