Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit 00b1866

Browse files
Ghislain BeaulacGhislain Beaulac
authored andcommitted
refactor(example): add editors inside the example to test issue #53
- cannot reproduce error reported in issue, it works as intended
1 parent cc3a780 commit 00b1866

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

src/app/examples/grid-rowselection.component.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, Injectable, OnInit } from '@angular/core';
2-
import { AngularGridInstance, Column, FieldType, Formatters, GridOption } from './../modules/angular-slickgrid';
2+
import { AngularGridInstance, Column, Editors, FieldType, Formatters, GridOption } from './../modules/angular-slickgrid';
33

44
@Component({
55
templateUrl: './grid-rowselection.component.html'
@@ -45,22 +45,24 @@ export class GridRowSelectionComponent implements OnInit {
4545

4646
prepareGrid() {
4747
this.columnDefinitions1 = [
48-
{id: 'title', name: 'Title', field: 'title', sortable: true, type: FieldType.string},
49-
{id: 'duration', name: 'Duration (days)', field: 'duration', sortable: true, type: FieldType.number},
50-
{id: 'complete', name: '% Complete', field: 'percentComplete', formatter: Formatters.percentCompleteBar, type: FieldType.number, sortable: true},
51-
{id: 'start', name: 'Start', field: 'start', formatter: Formatters.dateIso, sortable: true, type: FieldType.dateIso, exportWithFormatter: true },
52-
{id: 'finish', name: 'Finish', field: 'finish', formatter: Formatters.dateIso, sortable: true, type: FieldType.date, exportWithFormatter: true },
53-
{id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven', formatter: Formatters.checkmark, type: FieldType.number, sortable: true}
48+
{ id: 'title', name: 'Title', field: 'title', sortable: true, type: FieldType.string, editor: { model: Editors.longText } },
49+
{ id: 'duration', name: 'Duration (days)', field: 'duration', sortable: true, type: FieldType.number, editor: { model: Editors.integer } },
50+
{ id: 'complete', name: '% Complete', field: 'percentComplete', formatter: Formatters.percentCompleteBar, type: FieldType.number, sortable: true },
51+
{ id: 'start', name: 'Start', field: 'start', formatter: Formatters.dateIso, sortable: true, type: FieldType.dateIso, editor: { model: Editors.date } },
52+
{ id: 'finish', name: 'Finish', field: 'finish', formatter: Formatters.dateIso, sortable: true, type: FieldType.date, editor: { model: Editors.date }, exportWithFormatter: true },
53+
{ id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven', formatter: Formatters.checkmark, type: FieldType.number, sortable: true }
5454
];
5555
this.columnDefinitions2 = [
56-
{id: 'title', name: 'Title', field: 'title', sortable: true, type: FieldType.string},
57-
{id: 'duration', name: 'Duration (days)', field: 'duration', sortable: true, type: FieldType.number},
58-
{id: 'complete', name: '% Complete', field: 'percentComplete', formatter: Formatters.percentCompleteBar, type: FieldType.number, sortable: true},
59-
{id: 'start', name: 'Start', field: 'start', formatter: Formatters.dateIso, sortable: true, type: FieldType.dateIso, exportWithFormatter: true },
60-
{id: 'finish', name: 'Finish', field: 'finish', formatter: Formatters.dateIso, sortable: true, type: FieldType.date, exportWithFormatter: true },
61-
{id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven', formatter: Formatters.checkmark, type: FieldType.number, sortable: true}
56+
{ id: 'title', name: 'Title', field: 'title', sortable: true, type: FieldType.string },
57+
{ id: 'duration', name: 'Duration (days)', field: 'duration', sortable: true, type: FieldType.number },
58+
{ id: 'complete', name: '% Complete', field: 'percentComplete', formatter: Formatters.percentCompleteBar, type: FieldType.number, sortable: true },
59+
{ id: 'start', name: 'Start', field: 'start', formatter: Formatters.dateIso, sortable: true, type: FieldType.dateIso, exportWithFormatter: true },
60+
{ id: 'finish', name: 'Finish', field: 'finish', formatter: Formatters.dateIso, sortable: true, type: FieldType.date, exportWithFormatter: true },
61+
{ id: 'effort-driven', name: 'Effort Driven', field: 'effortDriven', formatter: Formatters.checkmark, type: FieldType.number, sortable: true }
6262
];
6363
this.gridOptions1 = {
64+
editable: true,
65+
autoEdit: true,
6466
enableAutoResize: false,
6567
enableCellNavigation: true,
6668
enableCheckboxSelector: true,

0 commit comments

Comments
 (0)