Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo ui grid if else condition

What is wrong with my code?

I have to check in kendo UI grid is there "OrderType 20" in my column. If it is, I need to apply my css condition which includes background, but it does not work, can someone help me? thanks

template: '# if (OrderType == "OrderType 20") {#<div class='customClass'>#:OrderType#</div>#} else {#OrderType#}#'
like image 547
Aviator Avatar asked Feb 11 '15 16:02

Aviator


2 Answers

It might help you for nested if else for kendo ui grid row template. i.e.

template: "#if(ErrorDesc==null){# #: DeviceLabel # #}else If(ErrorDesc==""){# #: DeviceLabel # #}else{# #: DeviceText # #}#"
like image 156
Anil Singh Avatar answered Oct 12 '22 23:10

Anil Singh


{
  field: "status",
  title: "Status",
  width: "80px",
  template: "#  if (status == '1' ) { # <center><span 
                style='color:green;'>Active</span></center> #
            } 
            else if (status == '0'){ # 
               <center><span style='color:red;'>Deactive</span></center> 
            #} #"
}
like image 20
bilal chaudhari Avatar answered Oct 12 '22 22:10

bilal chaudhari