This is a migrated thread and some comments may be shown as answers.

Compare 2 columns in AngularJS Kendo Grid

1 Answer 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Danny
Top achievements
Rank 1
Danny asked on 25 Jul 2017, 02:59 PM

How do I compare to columns and then change the background color of one column

 

something like

 

if(Ihours > kHours)

Ihours.backgroud.color = red;

 

bad code but just getting my point across

Thanks

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 27 Jul 2017, 08:20 AM
Hello Danny,

The desired result can be achieved using the column.template property and an if statement inside the template to compare the values from the columns:

https://admin.telerik.com/docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.template

http://docs.telerik.com/kendo-ui/framework/templates/overview#template-syntax

I made a Dojo example to demonstrate a similar implementation in AngularJS application:

http://dojo.telerik.com/iwuqO

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
Tags
Grid
Asked by
Danny
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or