Stizz1e
Stizz1e

Reputation: 59

How to display checkbox in Kendo Grid column

I am trying to display a checkbox in my grid but I keep running into an error. My checkbox template is this:{ field: "IsForeign", title: "Is <br/> Foreign", width: "120px", dataType: "bool", template: '<input type="checkbox" #= IsForeign == "true" ? checked="checked" : "" # />' } However I keep getting an error that 'IsForeign' is undefined. When I run the grid without the checkbox template everything renders correctly.

Upvotes: 0

Views: 478

Answers (1)

AGH
AGH

Reputation: 353

You will have to define define IsForeign in grid schema model and replace your code with this.

<input type="checkbox" #= IsForeign? \'checked="checked"\' : "" # >

I hope it will help you :)

Upvotes: 1

Related Questions