this.grid.reflow() not triggering methods defined in cellClasses
We have a dynamic column grid and required cellClasses methods comes along with column attribute. Conditions/Values changed whenever sorting/filtering done and we are using grid.filteredSortedData.slice() to get data for processing and returning conditions/values for cellClasses .Once processing done we are applying the style using this.grid.reflow() method.It works fine on igniteui-angular @7.2.3
We are planing to upgrade IgniteUI for Angular @7.3.x to use Grid Мulti-cell Selection feature. Once we try to upgrade version, existing mentioned above functionalities are not working as expected because this.grid.reflow() method not triggering methods defined in cellClasses.
I have created two simple samples to reproduce the issue.
- version igniteui-angular": "7.2.3" which we are using. In this sample every time on click of Set Classes button it is updating the value and apply style accordingly. https://igxgrid-reflow-7-3-12-k53ern.stackblitz.io https://stackblitz.com/edit/igxgrid-reflow-7-3-12-k53ern
- Same code using igniteui-angular": "7.3.15 . Not working as expected. https://igxgrid-reflow-7-3-12-uwrp6f.stackblitz.io https://stackblitz.com/edit/igxgrid-reflow-7-3-12-uwrp6f
Please let me know any solution to upgrade version with out affecting existing functionalities.
Hello @rssureshkumar , I investigate the described problem and this is not a bug, there is just a behavioral change because of the implemented performance improvement. Now we try to minimize unnecessary recalculation of the functions related with the applied cell styles, so to trigger the recalculation you should pass new object reference to the cellClass property
public onClick() { ... this.num2=Math.random()*100; this.customStyle = { 'class1': this.callback ,'class2': this.callback1}; this.grid1.markForCheck(); }
Look the attached sample.
Hello @ddincheva
It may be bug or performance improvement but it is affecting excising functionality. I need solution to trigger the methods defined in cellclasses. I have already checked with support team.For more details please refer CASE NUMBER / CAS-203333-P4W5T7. Could you please suggest using my sample . We are using dynamic column and cellclasses from column attribute.
The solution for your issue is absolutely analogical, here is the provided sample from you with applied necessary corrections.
@ddincheva
Thanks for the sample. I can able to fix the issue by this way. let me know the actual use of reflow() and markForCheck().