RealGrid2 Guide
Data Management
Boolean type field

Boolean type field

The DataProvider stores the value of a Boolean field as either undefined or false/true.

booleanFormat

The cell editor's booleanFormat property specifies a format separated by a colon (:), such as "false,f:true:0".

  • The first clause specifies values to be interpreted as false.
  • In the second section, specify values to be interpreted as true.
  • In the third bar, enter 1 if case is to be sensitive, or 0 if interpreted without distinction.

booleanFormat settings

Each field except the "Values" column is assigned a booleanFormat property to convert raw values to Boolean values. Additionally, the style's booleanFormat property and the editor's booleanFormat are specified for each "Boolean" column.

Only information about the Boolean1 column was displayed. If you are curious about the remaining columns, click the ‘View full code’ button located at the bottom right of the grid to check.

//Field settings
var fields = [
    {
        fieldName: "Boolean1",
        dataType: "boolean",
        booleanFormat: "False,N,0:True,Y,1:0",
    },
];
 
dataProvider.setFields(fields);
 
//Column settings
var columns = [
    {
        fieldName: "Boolean1",
        width: "120",
        header: {
            text: "Boolean 1",
        },
        editor: {
            booleanFormat: "Lie,f,false:Truth,t,true:0",
            emptyValue: false,
        },
        booleanFormat: "Lie:Truth",
    },
];
 
gridView.setColumns(columns);