rowClass rowCallback function is continuously called

1 Answer 882 Views
Grid Styling
Steve
Top achievements
Rank 1
Steve asked on 06 May 2021, 02:56 PM

I'm trying to implement the basic rowClass rowCallback example shown here: https://stackblitz.com/edit/angular-yh8zyr?file=app/app.component.ts, and I noticed in my local environment the rowCallback is being called continuously. Logging out a value in the function will fill the entire console, and inspecting the element shows the class being added to the row is flashing consistently from being added over and over.

Is there any way to figure out what is causing this? I've tried to just implement the example in the link with a basic grid and hard coded array of data, but still experiencing the same issue. Any help appreciated. Thanks!

Steve

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 07 May 2021, 11:46 AM

Hello Steve,

The rowClass callback function is directly passed as a value to the ngClass directive, which is then applied on each row. Any behaviour that is observed from there on, lies in the internal specifics of the Angular library. For example the linked demo is built in dev mode, in which case an additional change detection cycle is being triggered. This is the reason why each binding is evaluated for a second time.

I hope this information helps.

Regards,
Dimiter Madjarov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Steve
Top achievements
Rank 1
commented on 07 May 2021, 02:54 PM

Thanks for the response Dimiter. I think in my case there is something else at play. The rowClass callback function is being called more than just twice, it really is being called over and over. Maybe something in my project is triggering the change detection cycle non-stop. I will keep digging, thank you.
Tags
Grid Styling
Asked by
Steve
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or