0

Stack of the application: Angular 8, Typescript, Ag-Grid-Community.

export class HomeComponent implements OnInit, OnDestroy {

missingValues : [];

columnDefs = [
{
headerName : 'student_Id',
field : 'student_Id',
valueGetter : function(params) {
if(typeof(params.data.student_Id) ==='number'){
return params.data.student_Id;
}
else {
console.log(params.node.rowIndex);
console.log(params.colDef.headerName);
return 'Please enter stuent Id';
}
}
}
]

validate() {
console.log(this.missingValues);
}
}

So, I am able to print params.node.rowIndex and params.colDef.headerName in console for current page.

(i) valueGetter method is triggered for the current page items. Not for all the page items. How to fix this?

(ii) But I need to push these values to this.missingValues (global variable) so that I can show missing values in on a modal component when the validate button is clicked to the user. How to do this step?

Please let me know the solution, Is this best practice for real-time projects and correct me If I am wrong.

Thanks in advance.

venkat k
  • 1
  • 1
  • 3
  • Does this answer your question? [AG Grid: Better way for validation row - valueSetter?](https://stackoverflow.com/questions/52710350/ag-grid-better-way-for-validation-row-valuesetter) – un.spike Mar 08 '20 at 09:06
  • I got a couple of ideas when I looked at this. That does not answer my situation. Please let me know If you want more explanation from my question. – venkat k Mar 08 '20 at 18:44
  • Whats unclear on examples then? – un.spike Mar 09 '20 at 18:26

0 Answers0