|
1 | 1 | 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'; |
3 | 3 |
|
4 | 4 | @Component({ |
5 | 5 | templateUrl: './grid-rowselection.component.html' |
@@ -45,22 +45,24 @@ export class GridRowSelectionComponent implements OnInit { |
45 | 45 |
|
46 | 46 | prepareGrid() { |
47 | 47 | 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 } |
54 | 54 | ]; |
55 | 55 | 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 } |
62 | 62 | ]; |
63 | 63 | this.gridOptions1 = { |
| 64 | + editable: true, |
| 65 | + autoEdit: true, |
64 | 66 | enableAutoResize: false, |
65 | 67 | enableCellNavigation: true, |
66 | 68 | enableCheckboxSelector: true, |
|
0 commit comments