Skip to content

Commit 0b2c8ec

Browse files
committed
Merge branch 'rkaraivanov/multi-column-headers' of https://github.com/IgniteUI/igniteui-angular into rkaraivanov/multi-column-headers
2 parents 278fe9e + 064c301 commit 0b2c8ec

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

projects/igniteui-angular/src/lib/grid/grid-header.component.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import { DataType } from '../data-operations/data-util';
1717
import { SortingDirection } from '../data-operations/sorting-expression.interface';
1818
import { RestrictDrag } from '../directives/dragdrop/dragdrop.directive';
1919
import { IgxGridAPIService } from './api.service';
20-
import { IgxGridCellComponent } from './cell.component';
2120
import { IgxColumnComponent } from './column.component';
2221
import { autoWire, IGridBus, IgxColumnMovingService } from './grid.common';
2322

@@ -153,6 +152,7 @@ export class IgxGridHeaderComponent implements IGridBus, OnInit, DoCheck, AfterV
153152
@HostListener('click', ['$event'])
154153
@autoWire(true)
155154
public onClick(event) {
155+
156156
if (!this.column.grid.isColumnResizing) {
157157
event.stopPropagation();
158158
if (this.column.sortable) {
@@ -190,7 +190,8 @@ export class IgxGridHeaderComponent implements IGridBus, OnInit, DoCheck, AfterV
190190
const actualWidth = this.elementRef.nativeElement.getBoundingClientRect().width;
191191

192192
if (this.column.pinned) {
193-
const pinnedMaxWidth = this._pinnedMaxWidth = this.grid.calcPinnedContainerMaxWidth - this.grid.pinnedWidth + actualWidth;
193+
const pinnedMaxWidth = this._pinnedMaxWidth =
194+
this.grid.calcPinnedContainerMaxWidth - this.grid.getPinnedWidth(true) + actualWidth;
194195

195196
if (this.column.maxWidth && parseFloat(this.column.maxWidth) < pinnedMaxWidth) {
196197
this._pinnedMaxWidth = this.column.maxWidth;
@@ -301,7 +302,7 @@ export class IgxGridHeaderComponent implements IGridBus, OnInit, DoCheck, AfterV
301302
const size = Math.ceil(largestCell + largestCellPadding) + 'px';
302303

303304
if (this.column.pinned) {
304-
const newPinnedWidth = this.grid.pinnedWidth - currentColWidth + parseFloat(size);
305+
const newPinnedWidth = this.grid.getPinnedWidth(true) - currentColWidth + parseFloat(size);
305306

306307
if (newPinnedWidth <= this.grid.calcPinnedContainerMaxWidth) {
307308
this.column.width = size;

projects/igniteui-angular/src/lib/grid/grid.common.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ export class IgxColumnMovingDragDirective extends IgxDragDirective {
337337

338338
this._dragGhost.style.height = null;
339339
this._dragGhost.style.minWidth = null;
340-
this._dragGhost.style.flexBasis = null;
340+
this._dragGhost.style.flexBasis = null;
341+
this._dragGhost.style.position = null;
341342

342343
const icon = document.createElement('i');
343344
const text = document.createTextNode('block');
@@ -434,7 +435,7 @@ export class IgxColumnMovingDropDirective extends IgxDropDirective implements On
434435
}
435436

436437
if (!this.cms.column.pinned && this.column.pinned) {
437-
const nextPinnedWidth = this.column.grid.getPinnedWidth() + parseFloat(this.cms.column.width);
438+
const nextPinnedWidth = this.column.grid.getPinnedWidth(true) + parseFloat(this.cms.column.width);
438439

439440
if (nextPinnedWidth <= this.column.grid.calcPinnedContainerMaxWidth) {
440441
this.cms.icon.innerText = 'lock';
@@ -497,7 +498,7 @@ export class IgxColumnMovingDropDirective extends IgxDropDirective implements On
497498

498499
let nextPinnedWidth;
499500
if (this.column.pinned && !this.cms.column.pinned) {
500-
nextPinnedWidth = this.column.grid.getPinnedWidth() + parseFloat(this.cms.column.width);
501+
nextPinnedWidth = this.column.grid.getPinnedWidth(true) + parseFloat(this.cms.column.width);
501502
}
502503

503504
if ((nextPinnedWidth && nextPinnedWidth > this.column.grid.calcPinnedContainerMaxWidth) ||
@@ -510,7 +511,7 @@ export class IgxColumnMovingDropDirective extends IgxDropDirective implements On
510511

511512
let col;
512513
const selectedCells = this.cms.column.grid.selectedCells;
513-
if (selectedCells && this.cms.column.grid.selectedCells.length > 0) {
514+
if (selectedCells && selectedCells.length > 0) {
514515
col = selectedCells[0].column;
515516
}
516517

0 commit comments

Comments
 (0)