Need some guidance adding a conditional code within a template. Without the conditional logic below, all is well. Please see the code in bold below. Thanks for any feedback you might provide.
$("#mysgrid").kendoGrid({
dataSource: {
transport: {
read: {
url: "myurl",
dataType: "json",
data: {
eventclusterid: x,
json: 'true'
}
}
} ,
schema: {
data: function(roledata) {
return mydata;
}
}
},
columns:[
{ field: "description", title: "Role Description"},
{ field: "roleid", title: "Assigned", width: "75px",
template: '#if (eventclusterid > 0)
{# <input type="checkbox" name="roleid" value="#= roleid #" checked="checked"> #}
else
{# <input type="checkbox" name="roleid" value="#= roleid #"> #} #'
}
],
sortable: true, selectable: "multiple", navigatable: true
});
$("#mysgrid").kendoGrid({
dataSource: {
transport: {
read: {
url: "myurl",
dataType: "json",
data: {
eventclusterid: x,
json: 'true'
}
}
} ,
schema: {
data: function(roledata) {
return mydata;
}
}
},
columns:[
{ field: "description", title: "Role Description"},
{ field: "roleid", title: "Assigned", width: "75px",
template: '#if (eventclusterid > 0)
{# <input type="checkbox" name="roleid" value="#= roleid #" checked="checked"> #}
else
{# <input type="checkbox" name="roleid" value="#= roleid #"> #} #'
}
],
sortable: true, selectable: "multiple", navigatable: true
});