Skip to content

Commit 71632c5

Browse files
authored
Merge pull request #2878 from IgniteUI/13-migrations-manual
13 migrations manual
2 parents 5651c04 + c0b9137 commit 71632c5

15 files changed

Lines changed: 44 additions & 39 deletions

File tree

projects/app-lob/src/app/grid/grid-boston-marathon/grid.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export class GridComponent implements OnInit, OnDestroy, AfterViewInit {
128128

129129
public cellSelection(evt) {
130130
const cell = evt.cell;
131-
this.grid1.selectRows([cell.row.rowID], true);
131+
this.grid1.selectRows([cell.row.key], true);
132132
}
133133

134134
public getIconType(cell) {

src/app/grid/grid-batch-editing/grid-batch-editing-sample.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[rowEditable]="true">
44
<igx-column [editable]="false">
55
<ng-template igxCell let-cell="cell" let-val>
6-
<button igxButton (click)="grid.deleteRow(cell.id.rowID)"
6+
<button igxButton (click)="cell.id.rowID"
77
[disabled]="cell.row.deleted">Delete</button>
88
</ng-template>
99
</igx-column>

src/app/grid/grid-composite-data-binding/grid-composite-data.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<input #postalCode igxInput [(ngModel)]="cell.row.data.PostalCode" />
7272
</igx-input-group>
7373
<br>
74-
<span><strong>Phone:</strong> {{cell.row.data.Phone}}</span>
74+
<span><strong>Selected:</strong> {{cell.row.selected}}</span>
7575
<igx-input-group width="100%">
7676
<input #postalCode igxInput [(ngModel)]="cell.row.data.Phone" />
7777
</igx-input-group>

src/app/grid/grid-drop-indicator/grid-drop-indicator.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { IDragMoveEventArgs, IDropDroppedEventArgs, IgxGridComponent, IRowDragSt
33
import { DATA } from '../../data/customers';
44
import { Subject, interval, Observable, Subscription } from 'rxjs';
55
import { takeUntil } from 'rxjs/operators';
6+
import { IgxRowDirective } from 'igniteui-angular/lib/grids/row.directive';
67

78
@Component({
89
selector: 'app-grid-drop-indicator',
@@ -56,7 +57,7 @@ export class GridDropIndicatorComponent implements AfterViewInit, OnDestroy {
5657
}
5758

5859
private getRowIndexAtPoint(
59-
rowList: any[],
60+
rowList: IgxRowDirective[],
6061
cursorPosition: Point
6162
): number {
6263
for (const row of rowList) {
@@ -68,7 +69,7 @@ export class GridDropIndicatorComponent implements AfterViewInit, OnDestroy {
6869
cursorPosition.x < rowRect.right + window.scrollX
6970
) {
7071
// return the index of the targeted row
71-
return this.data.indexOf(this.data.find(r => r.ID === row.rowID));
72+
return this.data.indexOf(this.data.find(r => r.ID === row.key));
7273
}
7374
}
7475

src/app/grid/grid-keyboardnav-guide-sample/grid-keyboardnav-sample.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ export class GridKeyboardnavGuide implements OnInit, OnDestroy {
309309
if (this._keyboardHandler.gridSection === GridSection.TBODY) {
310310
if (key === 'enter') {
311311
const cell = this.grid.getCellByColumnVisibleIndex(activeNode.row, activeNode.column);
312+
const isCellSelected = cell.selected;
312313
if (cell && cell.column.editable && cell.editMode) {
313314
this._keyboardHandler.selectItem(0);
314315
}

src/app/grid/grid-multiple-row-drag/grid-multiple-row-drag.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import { Component, ViewChild } from '@angular/core';
3-
import { IgxGridComponent } from 'igniteui-angular';
3+
import { IDropDroppedEventArgs, IgxGridComponent } from 'igniteui-angular';
44
import { DATA } from '../../data/customers';
55
@Component({
66
selector: 'app-grid-multiple-row-drag',
@@ -27,7 +27,7 @@ export class GridMultipleRowDragComponent {
2727
args.animation = true;
2828
}
2929

30-
public onDropAllowed(args) {
30+
public onDropAllowed(args: IDropDroppedEventArgs) {
3131
let selected = false;
3232
const ids = this.sourceGrid.selectedRows;
3333
const selectedRowData = this.sourceGrid.data.filter((record) => ids.includes(record.ID));
@@ -37,8 +37,8 @@ export class GridMultipleRowDragComponent {
3737
this.sourceGrid.deleteRow(rowData.ID);
3838
});
3939
if (selected === false) {
40-
this.targetGrid.addRow(args.dragData.rowData);
41-
this.sourceGrid.deleteRow(args.dragData.rowID);
40+
this.targetGrid.addRow(args.dragData.data);
41+
this.sourceGrid.deleteRow(args.dragData.key);
4242
}
4343
}
4444

src/app/grid/grid-paste/grid-paste-sample.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class GridPasteSampleComponent {
7272
return;
7373
}
7474
const rowIndex = cell.row.index;
75-
// const rowPkValue = cell.row.rowData[pk];
75+
// const rowPkValue = cell.row.key;
7676
const cellIndex = cell.column.visibleIndex;
7777
const columns = this.grid1.visibleColumns;
7878
let index = 0;

src/app/grid/grid-row-drag-base/grid-row-drag-base.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/naming-convention */
22
import { Component, ViewChild } from '@angular/core';
3-
import { IgxGridComponent } from 'igniteui-angular';
3+
import { IDropDroppedEventArgs, IgxGridComponent } from 'igniteui-angular';
44
import { DATA } from '../../data/customers';
55

66
// eslint-disable-next-line no-shadow
@@ -30,9 +30,9 @@ export class GridDragBaseSampleComponent {
3030
args.animation = true;
3131
}
3232

33-
public onDropAllowed(args) {
34-
this.targetGrid.addRow(args.dragData.rowData);
35-
this.sourceGrid.deleteRow(args.dragData.rowID);
33+
public onDropAllowed(args: IDropDroppedEventArgs) {
34+
this.targetGrid.addRow(args.dragData.data);
35+
this.sourceGrid.deleteRow(args.dragData.key);
3636
}
3737

3838
public onEnterAllowed(args) {

src/app/grid/grid-row-drag-to-grid/grid-row-drag-to-grid.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/naming-convention */
22
import { Component, ViewChild } from '@angular/core';
3-
import { IgxGridComponent } from 'igniteui-angular';
3+
import { IDropDroppedEventArgs, IgxGridComponent } from 'igniteui-angular';
44
import { DATA } from '../../data/customers';
55

66
// eslint-disable-next-line no-shadow
@@ -30,9 +30,9 @@ export class GridDragToGridSampleComponent {
3030
args.animation = true;
3131
}
3232

33-
public onDropAllowed(args) {
34-
this.targetGrid.addRow(args.dragData.rowData);
35-
this.sourceGrid.deleteRow(args.dragData.rowID);
33+
public onDropAllowed(args: IDropDroppedEventArgs) {
34+
this.targetGrid.addRow(args.dragData.data);
35+
this.sourceGrid.deleteRow(args.dragData.key);
3636
}
3737

3838
public onEnterAllowed(args) {

src/app/grid/grid-row-drag/grid-row-drag.component.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* eslint-disable @typescript-eslint/naming-convention */
22
import { Component, ViewChildren } from '@angular/core';
3+
import { RowType } from 'igniteui-angular';
34
import { moonData, planetData } from './data';
45
import { PlanetComponent as PlanetComponent } from './planet/planet.component';
56

@@ -37,7 +38,7 @@ export class GridDragSampleComponent {
3738

3839
public onEnter(args, planet: PlanetComponent) {
3940
args.drag.ghostElement.classList.add(
40-
this.isDropAllowed(args.dragData.rowData.name, planet.name) ? HoverClassList.ALLOW : HoverClassList.DENY);
41+
this.isDropAllowed(args.dragData.data.name, planet.name) ? HoverClassList.ALLOW : HoverClassList.DENY);
4142
}
4243

4344
public onLeave(args) {
@@ -50,10 +51,10 @@ export class GridDragSampleComponent {
5051
}
5152

5253
public onDrop(args, planet: PlanetComponent) {
53-
const row: any = args.dragData;
54+
const row: RowType = args.dragData;
5455
if (this.isDropAllowed(row.data.name, planet.name)) {
5556
row.data.planet = planet.name;
56-
row.grid.selectRows([row.rowID]);
57+
row.grid.selectRows([row.key]);
5758

5859
planet.moonsCount++;
5960
}

0 commit comments

Comments
 (0)