Skip to main content

type

Optional. Defines the type of a column

Usage

type?: "string" | "number" | "boolean" | "date";

Default value: "string"

Example

const grid = new dhx.Grid("grid_container", {
columns: [
{ id: "quantity", type: "number", header: [{ text: "Quantity" }] },
// more columns configuration objects
],
// more options
});

The type sets the alignment of the content and defines the type of the editor used in the column:

  • "string" (the default one) - aligns data to the left side and applies the "input"/"textarea" editor
  • "number" - aligns data to the right side and applies the "input" editor
  • "boolean" - aligns data to the left side and applies the "checkbox" editor
  • "date" - aligns data to the left side and applies the "datePicker" editor