Skip to content

Commit

Permalink
refactor(example): fixed onCellChange event and advertise delete feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Jun 2, 2018
1 parent e33ee95 commit ec1c91a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions aurelia-slickgrid/src/examples/slickgrid/example3.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h2>${title}</h2>
<strong>Updated Item:</strong> ${updatedObject | stringify}
</div>
<div class="alert alert-warning" show.bind="alertWarning">
<strong></strong> ${alertWarning}
${alertWarning}
</div>
</div>

Expand All @@ -38,7 +38,7 @@ <h2>${title}</h2>
column-definitions.bind="columnDefinitions"
grid-options.bind="gridOptions"
dataset.bind="dataset"
sg-on-cell-changed.delegate="onCellChanged($event.detail.eventData, $event.detail.args)"
sg-on-cell-change.delegate="onCellChanged($event.detail.eventData, $event.detail.args)"
sg-on-click.delegate="onCellClicked($event.detail.eventData, $event.detail.args)"
asg-on-aurelia-grid-created.delegate="aureliaGridReady($event.detail)">
</aurelia-slickgrid>
Expand Down
4 changes: 2 additions & 2 deletions aurelia-slickgrid/src/examples/slickgrid/example3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ declare var Slick: any;

@autoinject()
export class Example3 {
title = 'Example 3: Editors';
title = 'Example 3: Editors / Delete';
subTitle = `
Grid with Inline Editors and onCellClick actions (<a href="https://github.com/ghiscoding/aurelia-slickgrid/wiki/Editors" target="_blank">Wiki docs</a>).
<ul>
Expand Down Expand Up @@ -244,7 +244,6 @@ export class Example3 {
onCellChanged(e, args) {
console.log('onCellChange', args);
this.updatedObject = args.item;
this.aureliaGrid.resizerService.resizeGrid(100);
}

onCellClicked(e, args) {
Expand All @@ -262,6 +261,7 @@ export class Example3 {
} else if (metadata.columnDef.id === 'delete') {
if (confirm('Are you sure?')) {
this.aureliaGrid.gridService.deleteDataGridItemById(metadata.dataContext.id);
this.alertWarning = `Deleted: ${metadata.dataContext.title}`;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion aurelia-slickgrid/src/examples/slickgrid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class Index {
const mapping: any = [
{ route: ['', 'example1'], moduleId: PLATFORM.moduleName('./example1'), name: 'example1', nav: true, title: '1- Basic Grid / 2 Grids' },
{ route: 'example2', moduleId: PLATFORM.moduleName('./example2'), name: 'example2', nav: true, title: '2- Formatters' },
{ route: 'example3', moduleId: PLATFORM.moduleName('./example3'), name: 'example3', nav: true, title: '3- Editors' },
{ route: 'example3', moduleId: PLATFORM.moduleName('./example3'), name: 'example3', nav: true, title: '3- Editors / Delete' },
{ route: 'example4', moduleId: PLATFORM.moduleName('./example4'), name: 'example4', nav: true, title: '4- Client Side Sort/Filter' },
{ route: 'example5', moduleId: PLATFORM.moduleName('./example5'), name: 'example5', nav: true, title: '5- Backend OData Service' },
{ route: 'example6', moduleId: PLATFORM.moduleName('./example6'), name: 'example6', nav: true, title: '6- Backend GraphQL Service' },
Expand Down

0 comments on commit ec1c91a

Please sign in to comment.