Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo Grid Client Template with Condition

 columns.Bound(p => p.Active).ClientTemplate("\\#if('#=Active#'=='Y') {\\<input type='button' value='OK' />\\}\\#").Width(150).Title("Status");

but condition is taken as string??

#if('Y'=='Y')`enter code here` {
<input type="button" value="OK">
}#  
like image 978
user2720297 Avatar asked Aug 27 '13 05:08

user2720297


2 Answers

Try this,

 columns.Bound(p => p.Active).ClientTemplate(
                "# if (IsServiceExist) { #" +
                    "<input type='button' value='OK' />"+
                "# }#").Width(150).Title("Status");
like image 85
Jaimin Avatar answered Sep 22 '22 15:09

Jaimin


I hope you get the solution....

columns.Bound(p => p.IsActive)
    .ClientTemplate(
        "\\# if (IsActive != false) { \\#" +
            "\\<input type=\"checkbox\" id=\"checkBox\" class=\"parentCheckBox\" window-call=\"template\" checked/>\\" +
        "\\# } else { \\#" + 
            "\\<input type=\"checkbox\" id=\"checkBox\" class=\"parentCheckBox\" window-call=\"template\" />\\" + 
        "#\\ } \\#")
    .Width(10);
like image 27
Bhavsar Jay Avatar answered Sep 19 '22 15:09

Bhavsar Jay