问题描述
我使用 cellRendererFormat 在我的 ag-grid 的第一列中设置复选框。
columnDefs: ColDef[] = [];
this.columnDefs{ headerName: 'Select',cellRendererFramework: AgGridCheckBoxComponent,field: 'isSelected',width: 30 },
我的 AgGridCheckBoxComponent 有以下定义:
export class AgGridCheckBoxComponent implements AgRendererComponent {
params: any;
agInit(params: ICellRendererParams): void {
this.params = params;
}
refresh(params: any): boolean {
params.data.isSelected = params.value;
params.api.refreshCells(params);
return false;
}
}
它的模板是:<input type="checkBox" [(ngModel)]="params.value" (change)="this.refresh(this.params)" />
如何使用此单元格渲染器格式启用全选或取消全选标题复选框?我尝试在 colDef 中为我的 ag-grid 添加 headerCheckBoxSelection true,但所选值没有更新
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)