This particular cell renderer is custom-made:
drop-down-cell-renderer.component.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-drop-down-cell-renderer',
templateUrl: './drop-down-cell-renderer.component.html',
styleUrls: ['./drop-down-cell-renderer.component.css']
})
export class DropDownCellRendererComponent implements OnInit {
constructor() { }
ngOnInit() {
}
params: any;
agInit(params: any): void {
this.params = params;
}
public RefreshRisqueBrutColumn() {
console.log('LISTENER WORKS')
}
}
drop-down-cell-renderer.component.html
<select class="form-control" (change)=" RefreshRisqueBrutColumn();">
<br>
<option>1- Très improbable</option>
<option>2- Peu probable</option>
<option>3- Possible</option>
<option>4- Probable</option>
</select>
https://i.sstatic.net/FYyZZ.png
My objective is to:
Capture and log the selected option number in a form-control using the change listener.
For example:
If user chooses option 0: Console will print: 0
If user picks option 1: Console will print: 1
And so on. Is there a way to do this without extra TypeScript code?
Thank you!