Skip to content

Boolean column type

BooleanColumnType renders typed boolean values and edits them with the Pro dropdown editor. It keeps the stored value separate from its translated label:

  • true renders as Yes.
  • false renders as No.
  • null and undefined render as an empty cell.
  • The editor offers Yes, No, and Not set; Not set saves null.
import { createBooleanColumnType } from '@revolist/revogrid-pro';
grid.columnTypes = {
boolean: createBooleanColumnType({
localeText: {
yes: 'Oui',
no: 'Non',
notSet: 'Non défini',
editorAriaLabel: 'Valeur booléenne',
},
}),
};
grid.columns = [
{ prop: 'approved', name: 'Approved', columnType: 'boolean' },
];

new BooleanColumnType(options) and createBooleanColumnType(options) are equivalent. Locale overrides are optional and merge with the English defaults.

interface BooleanColumnTypeLocaleText {
yes: string;
no: string;
notSet: string;
editorAriaLabel: string;
}

Translated labels affect rendering and editor options only. Source data remains true, false, or null.