Using Igniteui-angular 7.3.15
My scenario: I have 2 date columns that I want to provide a diff between. I thought I would just utilize an igxCell template and reference the dates from the rowData of the cell reference I have in place. My markup looks like this: <igx-column [dataType]="'number'" header="Custom" [resizable]="true"> <ng-template igxCell let-cell="cell"> <span>{{ getCalculatedValue(cell) }}</span> </ng-template> </igx-column>
This works and the grid renders the value retrieved from getCalculatedValue. However, the filter does not work for it. I have dug around in the docs but have yet to find anything pertaining to how to accomplish this.
Thanks!
Hello Eric,
We do not support filtering for a column without field. If you want to have a filtering for that column, I would suggest you to do this calculation in your data source instead of using cell templates.
Sincerely,Diyan Dimitrov
Shoot - thanks for verifying. It would be ideal if the 'field' property took a callback.
I did take an alternative route along the lines of what you suggest, but the challenge I see with that is that the changes of calc'd fields aren't reflected until the transactions are committed, which since we're set up to row-edit, we don't see the changes until after they've been posted.
You could handle the onCellEdit event and call the updateCell method for the calculated column when some of the date columns are changed.
If you require any further assistance on the matter, please let me know.