Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert: feat(grid): implement 'ed' event #10218

Merged
merged 19 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
chore(*): fix lint errros
  • Loading branch information
Volen99 committed Oct 1, 2021
commit 58aebb3a5b250fc8071b9a7ee2a33aa22ce8752b
23 changes: 0 additions & 23 deletions projects/igniteui-angular/src/lib/grids/grid-base.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3708,22 +3708,6 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
.pipe(takeUntil(this.destroy$))
.subscribe((change: QueryList<IgxGridRowComponent>) => {
this.onPinnedRowsChanged(change);

/* debugger
if (change.last && change.last.pinned) {
const row = new IgxGridRow(change.last.grid, change.last.index, change.last.rowData);
const eventArgs: IPinRowEventArgs = {
insertAtIndex: change.last.index,
isPinned: true,
rowID: change.last.rowID,
row: row
};

//this.gridAPI.get_row_by_key(changel.last.index)

this.rowPinned.emit(eventArgs);
}*/

});

this.addRowSnackbar?.clicked.subscribe(() => {
Expand Down Expand Up @@ -4807,7 +4791,6 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
* @param index The index at which to insert the row in the pinned collection.
*/
public pinRow(rowID: any, index?: number, row?: RowType): boolean {
debugger
if (this._pinnedRecordIDs.indexOf(rowID) !== -1) {
return false;
}
Expand All @@ -4827,13 +4810,10 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
this.pipeTrigger++;
if (this.gridAPI.grid) {
this.notifyChanges();
// Force pipe triggering
this.cdr.detectChanges();
this.rowPinned.emit(eventArgs)
}



return true;
}

Expand Down Expand Up @@ -6430,9 +6410,6 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
if (diff) {
this.notifyChanges(true);
}

// debugger
// this.rowPinned.emit();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,13 +461,13 @@ describe('Row Pinning #grid', () => {
fix.detectChanges();

expect(grid.gridAPI.get_row_by_index(0).rowID).toBe(fix.componentInstance.data[1]);
expect(grid.gridAPI.get_row_by_index(1).rowID).toBe(fix.componentInstance.data[4]);
expect(grid.gridAPI.get_row_by_index(1).rowID).toBe(fix.componentInstance.data[5]);

grid.sort({ fieldName: 'ID', dir: SortingDirection.Desc, ignoreCase: false });
fix.detectChanges();

// check pinned rows data is sorted
expect(grid.gridAPI.get_row_by_index(0).rowID).toBe(fix.componentInstance.data[4]);
expect(grid.gridAPI.get_row_by_index(0).rowID).toBe(fix.componentInstance.data[5]);
expect(grid.gridAPI.get_row_by_index(1).rowID).toBe(fix.componentInstance.data[1]);

// check unpinned rows data is sorted
Expand Down
5 changes: 0 additions & 5 deletions src/app/grid-row-pinning/grid-row-pinning.sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,6 @@ export class GridRowPinningSampleComponent implements OnInit, AfterViewInit {
];
this.selectionMode = GridSelectionMode.multiple;
/* eslint-enable max-len */

this.grid1.rowPinned.subscribe((event) => {
debugger
const row = this.state.getState(true, ['rowPinning']); // return value doesn't include the pinned row
});
}

public ngAfterViewInit() {
Expand Down