Notes Technical Reference

View as Markdown

Note State

NoteState

Note section of Adaptable State, including Initial State.

A Note is one piece of text on one cell, located by PrimaryKeyValue and ColumnId. It is separate from a Comment thread and from a Free Text Column. NoteType defaults to 'Info' and colours the cell indicator.

Extends

BaseState

Notes to show. One note occupies one cell.

Adaptable Note

AdaptableNote

One piece of text attached to one cell.

PrimaryKeyValue and ColumnId locate the cell. Text is the note. NoteType colours the indicator and defaults to 'Info'.

Author?

string

Author of the Note - uses AdaptableOptions.userName when Note is created

ColumnId

string

Id of Column containing the Note

CreatedAt?

number

When the Note was first created; maps to AG Grid's Note.createdAt

Type of Note - 'Info' | 'Warning' | 'Error' | 'Success'; drives colour of Cell Note indicator

Default

'Info'

Value in Grid's Primary Key Column

Text

string

Content of the Note

UpdatedAt?

number

When the Note was last updated; maps to AG Grid's Note.updatedAt

IsReadOnly?

boolean

Sets Entity to ReadOnly (overwriting a Strategy Entitlement of 'Full')

NoteType is an AdapTable message type: Success, Info, Warning, or Error.


Note Options

defaultNoteType is the same message type: Success, Info, Warning, or Error.

isCellNotable receives a NotableCellContext:

Hint

When a Note opens (hover vs click) is an AG Grid GridOptions setting — noteTrigger, plus optional noteShowDelay / noteHideDelay. See Opening Notes.


Note API

NoteApi

Notes attached to cells. Each note has text, a type, and the cell it belongs to.

deleteNote(note)
returns

void

Removes a note from state.

editNote(note)
returns

void

Replaces a note already in state.

Gets all Notes

Returns a Note by uuid

Gets all Notes for a cell

Gets the Note State

Sets Type of a Note ('Info' | 'Warning' | 'Error' | 'Success'), which drives colour of Note indicator

Replaces the text of a note.


Note Changed Event

The Note Changed Event fires whenever Note State changes — including edits made in AG Grid's Note editor, the Notes Settings Panel, and Note API calls.

NoteChangedInfo

The event comprises a single NoteChangedInfo object which contains details about what action triggered the change and the associated Note.

NoteChangedInfo

Payload of the NoteChanged event.

Fires when a Note is added, edited or deleted. actionName is Added, Edited or Deleted.

Extends , so adaptableApi is included.

What caused Note State to change (i.e. Added, Edited, Deleted)

Note that has been added, edited or deleted

Custom application Context provided in AdaptableOptions.adaptableContext

Action Names

The value for the actionName property can be one of:

  • Added
  • Edited
  • Deleted

Event Subscription

Subscribing to the Event is done the same way as with all Adaptable Events:

api.eventApi.on('NoteChanged', (eventInfo: NoteChangedInfo) => {
    // do something with the info
});