Configuring Notes

View as Markdown

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.

PropertySection
isCellNotableNotable Cells
defaultNoteTypeNote Types
dateFormatTimestamp 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) => boolean
Function enabling specific Cells to be excluded from Notes
Configuring Notable Cells
Fork
  • isCellNotable in adaptableOptions.ts blocks Notes when:
    • the cell is in the language column
    • the row’s license value is Other
Try It Out
  • Right-click a cell in the name column — Add Note is available
  • Right-click a cell in language, or any cell in a row whose license is Other — Add Note is not offered
Loading demo…

Note Types

Each Note has a NoteType of Info, Warning, Error or Success, which colours the triangle in the noted Cell:

TypeDefault 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: Info
AdaptableMessageType
Type given to a Note on creation

Run-time users change the Type of an existing Note in two places:

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-color on 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 withParams or the matching --ag-note-popup-* CSS variables
Deep Dive

Understanding AG Grid Theming Parameters

Notes CSS
Fork
  • Triangle — styles.css sets --ag-note-indicator-color for ab-NoteType-Info
  • Popup / editor — gridOptions.ts uses the AG Grid Theming API (notePopup* parameters)
  • Hover a noted cell in name or license to see the themed popup
Loading demo…

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:ss
String
Date Format to use for timestamps in Notes

Opening 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 + F2 still opens or creates a Note on the focused cell
Notes Click Trigger
Fork
  • noteTrigger: 'click' in gridOptions.ts — hovering a noted cell does nothing
Try It Out
  • Click a noted cell (e.g. Angular in name) to open its Note
  • Hovering the same cell will not open the Note
Loading demo…

Hint

AG Grid also provides noteShowDelay and noteHideDelay (milliseconds) to tune hover timing