Skip to content

Commit

Permalink
refactor(event): expose event to columnDef onCellClick and onCellChange
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Jun 2, 2018
1 parent ec1c91a commit 2ac3cd8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Expand Up @@ -138,10 +138,10 @@ export interface Column {
name?: string;

/** an event that can be used for triggering an action after a cell change */
onCellChange?: (args: OnEventArgs) => void;
onCellChange?: (e: Event, args: OnEventArgs) => void;

/** an event that can be used for triggering an action after a cell click */
onCellClick?: (args: OnEventArgs) => void;
onCellClick?: (e: Event, args: OnEventArgs) => void;

/** column output type */
outputType?: FieldType;
Expand Down
Expand Up @@ -31,7 +31,7 @@ export class GridEventService {
};

// finally call up the Slick.column.onCellChanges.... function
column.onCellChange(returnedArgs);
column.onCellChange(e, returnedArgs);
}
});
}
Expand All @@ -57,7 +57,7 @@ export class GridEventService {
};

// finally call up the Slick.column.onCellClick.... function
column.onCellClick(returnedArgs);
column.onCellClick(e, returnedArgs);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion aurelia-slickgrid/src/examples/slickgrid/example11.ts
Expand Up @@ -66,7 +66,7 @@ export class Example11 {
editor: {
type: Editors.text
},
onCellChange: (args: OnEventArgs) => {
onCellChange: (e: Event, args: OnEventArgs) => {
alert('onCellChange directly attached to the column definition');
console.log(args);
}
Expand Down
6 changes: 3 additions & 3 deletions aurelia-slickgrid/src/examples/slickgrid/example3.ts
Expand Up @@ -67,7 +67,7 @@ export class Example3 {
minWidth: 30,
maxWidth: 30,
// use onCellClick OR grid.onClick.subscribe which you can see down below
onCellClick: (args: OnEventArgs) => {
onCellClick: (e: Event, args: OnEventArgs) => {
console.log(args);
this.alertWarning = `Editing: ${args.dataContext.title}`;
this.aureliaGrid.gridService.highlightRow(args.row, 1500);
Expand All @@ -82,7 +82,7 @@ export class Example3 {
maxWidth: 30,
// use onCellClick OR grid.onClick.subscribe which you can see down below
/*
onCellClick: (args: OnEventArgs) => {
onCellClick: (e: Event, args: OnEventArgs) => {
console.log(args);
this.alertWarning = `Deleting: ${args.dataContext.title}`;
}
Expand All @@ -97,7 +97,7 @@ export class Example3 {
type: Editors.longText
},
minWidth: 100,
onCellChange: (args: OnEventArgs) => {
onCellChange: (e: Event, args: OnEventArgs) => {
console.log(args);
this.alertWarning = `Updated Title: ${args.dataContext.title}`;
}
Expand Down

0 comments on commit 2ac3cd8

Please sign in to comment.