Like false and true in JavaScript, if there are only two contrast values, you can use DataField which dataType is BOOLEAN. Actually as false and true values in JavaScript and the different types of field, BOOLEAN field saves three values including undefined in DataSet.
When save the value through GridDataSet.setValue, if it is not the above three explicit values but a string, it will be changed and saved according to the conversion rule specified through booleanFormat or booleanFormat of the corresponding field. An empty string and null are saved as undefined. The value which is not a string is changed and saved as false or true according to Boolean Conversion Rule in JavaScript.
Please refer to DataField.booleanFormat about the details of the conversion format.
Since the default booleanFormat is "false,f,0:true,t,1:0" in Grid-1, if Boolean() is not checked, "0", "false", "False" will be saved as false and "1", "true", "True" will be saved as true.
However, if Boolean() is checked to convert the values as Boolean type before adding the row, all of them will be converted as true if they are not empty strings. Please refer to Boolean document.
if ($('#chkBoolean').is(':checked')) {
for (var f in row) {
row[f] = Boolean(row[f]);
}
}
Basically, the value of Boolean field is converted and displayed as the format specified in GridStyles.booleanFormat. If the format is not specified, it will be displayed as "false" or "true". undefined is displayed as an empty string. Please refer to GridStyles.booleanFormat for more details about the format.
In Grid-2, it has specified booleanFormat of each column style individually as
"No;Yes;-", "Male;Female", "Unpaid;Paid;Reserved", "Failed;Passed".