import {ICellEditorAngularComp} from 'ag-grid-angular'; import {AfterViewInit, Component, ElementRef, ViewChild} from '@angular/core'; import {ICellEditorParams} from 'ag-grid-community'; @Component({ selector: 'cell-editor-paragraph', template: ``, styles: [ `input { width: 100%; border: 1px solid grey; }` ], }) export class BooleanEditorComponent implements ICellEditorAngularComp, AfterViewInit { private params: ICellEditorParams; public value: string; @ViewChild('input', {static: false}) input: ElementRef; agInit(params: ICellEditorParams): void { this.params = params; this.value = this.params.value; } getValue(): any { return this.value; } ngAfterViewInit(): void { this.onClick(); } onClick() { if ( this.value === 'True' ) { this.value = 'False'; } else if ( this.value === 'False' ) { this.value = ''; } else { this.value = 'True'; } } }