I have cell render class in Angular project that generate html input templates inside ag-grid cells. After horizontal scroll, as the input cells go off-screen the ag-grid re-renders these input element and the input elements loos their values. Below is my CellRenderer class:
export class TemplateRendererComponent implements ICellRendererAngularComp {
template: TemplateRef<any>;
templateContext: { $implicit: any, params: any };
refresh(params: any): boolean {
this.templateContext = {
$implicit: params.data,
params,
};
return true;
}
agInit(params: ICellRendererParams): void {
this.template = params[ 'ngTemplate' ];
this.refresh(params);
}
}
How to make this input elements keep their values?