I have a field that is a boolean but grid doesn’t fetch the value (0 or 1) correctly and doesn’t update properly if changed. It also doesn’t show checked using a template if the field (enabled) is 1.
But, if I set the field type to string instead of boolean, it all works as expected, but you have to type in 0 or 1 which is not what I want:
{
field: "enabled",
template: '<input type="checkbox" #= enabled == "1" ? checked="checked" : "" # />',
width: 50,
title: "Enabled"
}
If I use the template on the field as a boolean, all check boxes are blank as if “enabled” is always null, which it is not.
Example data coming from the server:
{"data":[{"id":"57","username":"adf@saddf.com","type":"1","level":"1","firstName":"asdf","middleName":"","lastName":"asdf","DoB":"0000-00-00","dateStarted":"0000-00-00","enabled":"1"}], "rowcount": 4}
How can I get this to work properly?
I figured it out.
Returned booleans must be in the form of literally “true” or “false”, not 1 or 0.