Configuring Notes
Summary
- Developers can configure which Cells in the Grid are able to receive Notes
- Notes can be given a Type that colours the cell indicator
- AG Grid GridOptions control whether Notes open on hover or click
Configure Notes through noteOptions in Adaptable Options and through AG Grid Note settings on gridOptions.
NoteOptions defines three AdapTable properties (all covered below). Hover timing and click vs hover use AG Grid’s noteTrigger, noteShowDelay, and noteHideDelay — see Opening Notes.
| Property | Section |
|---|---|
isCellNotable | Notable Cells |
defaultNoteType | Note Types |
dateFormat | Timestamp Format |
Indicator and popup theming use AdapTable Note Type CSS and the AG Grid Theme — see Theming Notes.
Notable Cells
By default all cells in AG Grid - even readonly ones - can receive a Note.
isCellNotable
(context: NotableCellContext) => booleanisCellNotableinadaptableOptions.tsblocks Notes when:- the cell is in the
languagecolumn - the row’s
licensevalue isOther
- the cell is in the
- Right-click a cell in the
namecolumn — Add Note is available - Right-click a cell in
language, or any cell in a row whoselicenseisOther— Add Note is not offered
Note Types
Each Note has a NoteType of Info, Warning, Error or Success, which colours the triangle in the noted Cell:
| Type | Default Colour and CSS Variable |
|---|---|
| Info | var(--ab-color-info) |
| Success | var(--ab-color-success) |
| Warning | var(--ab-color-warn) |
| Error | var(--ab-color-destructive) |
New Notes default to Info.
Hint
Use defaultNoteType in Note Options to stamp a different Type on creation
defaultNoteType
Default: InfoAdaptableMessageTypeRun-time users change the Type of an existing Note in two places:
- Set Note Type in the Context Menu
- the Type column in the Notes Settings Panel
Theming Notes
Notes have two themeable surfaces, and each is styled in a different way:
- The cell indicator triangle - drawn by AG Grid, but AdapTable recolours it per Note Type by setting
--ag-note-indicator-coloron noted cell
Hint
Override the ab-NoteType-<Type> classes to change these colours
- The in-cell Note popup / editor - drawn entirely by AG Grid
Note
- Theme this through your AG Grid Theme
- Do it either via the Theming API
withParamsor the matching--ag-note-popup-*CSS variables
Deep Dive
Understanding AG Grid Theming Parameters
- Triangle —
styles.csssets--ag-note-indicator-colorforab-NoteType-Info - Popup / editor —
gridOptions.tsuses the AG Grid Theming API (notePopup*parameters) - Hover a noted cell in
nameorlicenseto see the themed popup
Timestamp Format
AdapTable formats the Created and Last Updated timestamps shown in both the AG Grid Note popup and in the Notes Settings Panel.
The property is available in Note Options and returns a string (optionally via a function if required).
dateFormat
Default: dd-MM-yyyy HH:mm:ssStringOpening Notes
By default run-time users see a Note when the mouse hovers over a cell that contains one.
If hover is not wanted, set AG Grid's noteTrigger to 'click' in GridOptions so the Note opens when the cell is clicked instead.
Note
- The Context Menu still offers View Note / Edit Note
- And
Shift + F2still opens or creates a Note on the focused cell
noteTrigger: 'click'ingridOptions.ts— hovering a noted cell does nothing
- Click a noted cell (e.g. Angular in
name) to open its Note - Hovering the same cell will not open the Note
Hint
AG Grid also provides noteShowDelay and noteHideDelay (milliseconds) to tune hover timing