Have this column in a Kendo grid that currently display a MySQL Boolean value so we have either 1 or 0.
This in an autosync and inline:true grid.
I would like this column to be of type "Checkbox" but, for some weird reasons, i just cannot find a demo or an example on the web that displays "enabled" checkbox that changes 1 to 0 when unchecked and Vice-Versa.
I had the same problem with my batch edited grid. The solutions I found were only for one specific column (as the solution mentioned above). So I changed
to
So you can use it for any checkbox columns.
The next problem was the dirty flag which is not set correctly when using the "one click edit" option of checkbox.
So I've tested various things to get it work and endet up with this:
In column definition:
And script below:
There are some previous considerations:
boolean
as checkboxes for editing but not while not in edit mode.What you need to do is:
Template definition:
As you can see I'm not defining an editor function since we will change the value of the checkbox without entering in edition mode.
Define a handler that detect changes in the checkbox that I defined in the template and update the model.
Your JSBin modified here : http://jsbin.com/ebadaj/12/edit
Updated example for 2018!!
with themes. Kendo uses Themes so using the standard "browser-checkbox-look" (different in every browser) is not so nice.
https://dojo.telerik.com/IluJosiG/14