Datatypes

SpreadSheet Grid supports the following datatypes

export type DATATYPES =
| "null"
| "number"
| "string"
| "boolean"
| "error"
| "hyperlink";
note

We are actively working to add support for these datatypes

  1. Date
  2. Formula
  3. RichText

Number

const sheets = [
{
name: 'Sheet 1',
id: uuid(),
cells: {
1: {
1: {
datatype: 'number',
text: 200.00,
format: '\\S$ #.00'
}
}
}
},
]
fx

Sheet 1

String

const sheets = [
{
name: 'Sheet 1',
id: uuid(),
cells: {
1: {
1: {
datatype: 'string',
text: '1'
}
}
}
},
]
fx

Sheet 1

Boolean

Displays a checkbox

const sheets = [
{
name: 'Sheet 1',
id: uuid(),
cells: {
1: {
1: {
text: "TRUE",
datatype: 'boolean',
dataValidation: {
allowBlank: true,
type: "boolean",
formulae: ["TRUE", "FALSE"],
},
}
}
}
},
]
fx

Sheet 1

Hyperlink

const sheets = [
{
name: 'Sheet 1',
id: uuid(),
cells: {
1: {
1: {
datatype: 'hyperlink',
text: "Hello world",
color: "#1155CC",
underline: true,
hyperlink: "http://google.com",
}
}
}
},
]
fx

Sheet 1

Error

const sheets = [
{
name: 'Sheet 1',
id: uuid(),
cells: {
1: {
1: {
text: 'hello',
valid: false,
datatype: 'number',
dataValidation: {
type: 'decimal',
prompt: 'Enter a valid number'
}
}
}
}
},
]
fx

Sheet 1