Skip to content

Commit

Permalink
Fix edit data bugs (microsoft#2157)
Browse files Browse the repository at this point in the history
* fix edit data bugs

* formatting
  • Loading branch information
Anthony Dresser authored and kburtram committed Aug 7, 2018
1 parent 91cb99b commit ac2f279
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 35 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@angular/router": "~4.1.3",
"@angular/upgrade": "~4.1.3",
"angular2-grid": "2.0.6",
"angular2-slickgrid": "github:Microsoft/angular2-slickgrid#1.3.12",
"angular2-slickgrid": "github:Microsoft/angular2-slickgrid#1.4.1",
"applicationinsights": "0.18.0",
"chart.js": "^2.6.0",
"fast-plist": "0.1.2",
Expand Down
9 changes: 3 additions & 6 deletions src/sql/parts/grid/views/editData/editData.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@
showHeader="true"
[resized]="dataSet.resized"
[plugins]="plugins[i]"
(activeCellChanged)="onActiveCellChanged($event)"
(cellEditBegin)="onCellEditBegin($event)"
(cellEditExit)="onCellEditEnd($event)"
(rowEditBegin)="onRowEditBegin($event)"
(rowEditExit)="onRowEditEnd($event)"
(contextMenu)="openContextMenu($event, dataSet.batchId, dataSet.resultId, i)"
(onActiveCellChanged)="onActiveCellChanged($event)"
(onCellChange)="onCellEditEnd($event)"
(onContextMenu)="openContextMenu($event, dataSet.batchId, dataSet.resultId, i)"
[isCellEditValid]="onIsCellEditValid"
[overrideCellFn]="overrideCellFn"
enableEditing="true"
Expand Down
21 changes: 6 additions & 15 deletions src/sql/parts/grid/views/editData/editData.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,8 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On
protected plugins = new Array<Array<Slick.Plugin<any>>>();

// Edit Data functions
public onActiveCellChanged: (event: { row: number, column: number }) => void;
public onCellEditEnd: (event: { row: number, column: number, newValue: any }) => void;
public onCellEditBegin: (event: { row: number, column: number }) => void;
public onRowEditBegin: (event: { row: number }) => void;
public onRowEditEnd: (event: { row: number }) => void;
public onActiveCellChanged: (event: Slick.OnActiveCellChangedEventArgs<any>) => void;
public onCellEditEnd: (event: Slick.OnCellChangeEventArgs<any>) => void;
public onIsCellEditValid: (row: number, column: number, newValue: any) => boolean;
public onIsColumnEditable: (column: number) => boolean;
public overrideCellFn: (rowNumber, columnId, value?, data?) => string;
Expand Down Expand Up @@ -167,17 +164,11 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On

this.onActiveCellChanged = this.onCellSelect;

this.onCellEditEnd = (event: { row: number, column: number, newValue: any }): void => {
this.onCellEditEnd = (event: Slick.OnCellChangeEventArgs<any>): void => {
// Store the value that was set
self.currentEditCellValue = event.newValue;
self.currentEditCellValue = event.item[event.cell - 1];
};

this.onCellEditBegin = (event: { row: number, column: number }): void => { };

this.onRowEditBegin = (event: { row: number }): void => { };

this.onRowEditEnd = (event: { row: number }): void => { };

this.overrideCellFn = (rowNumber, columnId, value?, data?): string => {
let returnVal = '';
if (Services.DBCellValue.isDBCellValue(value)) {
Expand Down Expand Up @@ -233,10 +224,10 @@ export class EditDataComponent extends GridParentComponent implements OnInit, On
};
}

onCellSelect(event: { row: number, column: number }): void {
onCellSelect(event: Slick.OnActiveCellChangedEventArgs<any>): void {
let self = this;
let row = event.row;
let column = event.column;
let column = event.cell;

// Skip processing if the newly selected cell is undefined or we don't have column
// definition for the column (ie, the selection was reset)
Expand Down
10 changes: 0 additions & 10 deletions src/sql/parts/grid/views/gridParentComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,6 @@ export abstract class GridParentComponent {

@ViewChildren('slickgrid') slickgrids: QueryList<SlickGrid>;

// Edit Data functions
public onActiveCellChanged: (event: { row: number, column: number }) => void;
public onCellEditEnd: (event: { row: number, column: number, newValue: any }) => void;
public onCellEditBegin: (event: { row: number, column: number }) => void;
public onRowEditBegin: (event: { row: number }) => void;
public onRowEditEnd: (event: { row: number }) => void;
public onIsCellEditValid: (row: number, column: number, newValue: any) => boolean;
public overrideCellFn: (rowNumber, columnId, value?, data?) => string;
public loadDataFunction: (offset: number, count: number) => Promise<IGridDataRow[]>;

set messageActive(input: boolean) {
this._messageActive = input;
if (this.resultActive) {
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ angular2-grid@2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/angular2-grid/-/angular2-grid-2.0.6.tgz#01fe225dc13b2822370b6c61f9a6913b3a26f989"

"angular2-slickgrid@github:Microsoft/angular2-slickgrid#1.3.12":
version "1.3.12"
resolved "https://codeload.github.com/Microsoft/angular2-slickgrid/tar.gz/19aafe8888d2f2eb70aec858e4b86e3c1b7b3fc8"
"angular2-slickgrid@github:Microsoft/angular2-slickgrid#1.4.1":
version "1.4.1"
resolved "https://codeload.github.com/Microsoft/angular2-slickgrid/tar.gz/e13c098aa50f43de21a5fdcd1a1a0263455b92d6"

ansi-colors@^1.0.1:
version "1.1.0"
Expand Down

0 comments on commit ac2f279

Please sign in to comment.