Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hoangbits/375d652936099e2ce0c465e45ed3c97f to your computer and use it in GitHub Desktop.
Save hoangbits/375d652936099e2ce0c465e45ed3c97f to your computer and use it in GitHub Desktop.
import { Component, OnInit } from '@angular/core';
import { AgRendererComponent } from "ag-grid-angular/main";
import { ICellRendererParams } from "ag-grid-community";
@Component({
selector: 'app-ag-grid-material-checkbox-cell',
template: `<mat-checkbox (change)="toggleSelection($event)"></mat-checkbox>`
})
export class AgGridMaterialCheckboxCellComponent implements OnInit, AgRendererComponent {
private params: ICellRendererParams;
refresh(params: any): boolean {
return true;
}
agInit(params: ICellRendererParams): void {
this.params = params;
}
constructor() { }
ngOnInit() {
}
toggleSelection(event) {
this.params.node.setSelected(event.checked);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment