Skip to content

Multi-line, color and week editors ​

Since 1.5.0

cellEditor: 'textarea', cellEditor: 'color' and kind: 'week' are available since 1.5.0.

All three work on columns with editable: true. textarea and color need the optional editors bundle (maxgrid/editors in modular builds; the all-in-one bundle includes it). Without the bundle, creating the grid fails with invalid-option. week is in the base bundle like month.

Multi-line editor (textarea) ​

Type long text over several lines. The value is a string with lines joined by \n.

ts
{ id: 'memo', editable: true, cellEditor: 'textarea',
  editorParams: { rows: 5, maxLength: 200, resize: true } }
OptionValueDefaultMeaning
rowsinteger 1–124Lines of the edit box
maxLength1–10000noneCharacters that can be typed
resizebooleanfalseLet the edit box grow vertically
placeholderstringnoneHint shown while empty
Key or actionResult
Enter, Shift+EnterLine break (does not confirm)
Ctrl+Enter (⌘+Enter on Mac)Confirm
EscCancel (keeps the old value)
Tab, clicking another cellConfirm
While composing (IME)Keys are left alone; confirms after composing
  • Cell display: only the first line and …. With wrap: true on the column the line breaks show as they are, and with rowHeight: 'auto' the row grows.
  • Copy and export: the full text with line breaks is used.
  • Validation: maxLength, required and custom of validation apply. On failure the editor stays open and says why.

Multi-line example

Color editor (color) ​

Opens a swatch grid and a hex input. The value is a lowercase #rrggbb (#rrggbbaa with alpha: true). The browser's own <input type="color"> is not used.

ts
{ id: 'color', editable: true, cellEditor: 'color',
  editorParams: { swatches: ['#1a73e8', '#188038', '#d93025'], alpha: false } }
OptionValueDefaultMeaning
swatches1–64 hex color stringsdefault 16Swatch list. With alpha off, 8-digit colors are dropped
alphabooleanfalseAllow #rrggbbaa
Key or actionResult
Arrow keysMove over swatches (stops at the ends); the input shows the color
EnterConfirm the picked swatch or the typed text
TypingThe preview dot updates live; #abc expands to #aabbcc
Clicking a swatchConfirm that color
EscCancel (keeps the old value)
  • Validation: a wrong format keeps the editor open with "Enter a color as #rrggbb". An empty value clears to null.
  • Cell display: a small swatch and the hex text.
  • Paste: only #rgb and #rrggbb are accepted (text such as rgb() is rejected) and lowercased.

Color example

Week kind and editor (kind: 'week') ​

A column that picks an ISO 8601 week. Weeks start on Monday and the week with the first Thursday is week 1. The value is a string without a time zone, YYYY-Www (for example 2026-W47). Around New Year the year can differ from the calendar year (2024-12-30 is 2025-W01).

ts
{ id: 'sprint', title: 'Sprint week', kind: 'week', editable: true,
  dateTime: { min: '2026-W10', max: '2026-W40' } }
ItemBehavior
Open pickerOne row of the day grid is one week. Hover, selection and cursor cover the row; the week-number column is always shown
Pick a weekClicking any day in a row confirms that week as YYYY-Www
Arrow keysMove one week (← ↑ earlier, → ↓ later)
PageUp, PageDownMove one month
Home, EndFirst and last week of the year (week 53 in years that have it)
TypingYYYY-Www, YYYYWww, YYYY-ww. A week that does not exist (2025-W53) is rejected
dateTime.min/maxYYYY-Www. Weeks outside the range are disabled as a whole row
dateTime.weekStartIgnored (always Monday)
Display patternDefault YYYY-Www. format.date.pattern can use only GGGG (ISO year) and WW (ISO week)
Stored format (stored)Not available
  • Sort, group, filter: the same week is the same value. A Date value is read as the week of its day. Filter cells accept >=2026-W10 and 2026-W01..2026-W26.
  • Copy and paste: the typing formats above are accepted; wrong text is rejected with a reason.
  • Export: CSV, JSON and PDF use the YYYY-Www text. xlsx also writes a text cell, not a date cell. CSV import reads loose formats as YYYY-Www.

Week example, Week filter and export example