gridcn2.0.0
Add-on optionsServer

Comments labels and hooks

Look up the labels, the keys, and the DOM hooks of the comments popover.

The comments popover takes its text from labels, opens with a key, and exposes DOM hooks for styling. The options are on Comments options.

Keyboard and DOM hooks

KeysAction
Shift+F2Opens the popover for the active cell. A cell without comments opens the composer. The keymap name is openComments.
Shift+F10 or the menu keyWith DataGridContextMenu, opens the context menu. Its "Comments…" item opens the popover.
Mod+EnterSubmits the composer.
EscapeCancels a delete confirm. Otherwise it closes the popover and keeps the comment draft.
Tab past the last controlCloses the popover. The Tab order goes on from the grid.

The command openComments refuses holes and band rows. Viewing works on a read-only grid, and each write checks readOnly itself.

Labels

labels takes a partial DataGridCommentsLabels. A function label receives the values to insert, so a translation owns its plural form. The comments popover reads three layers. A later layer wins: the English defaults, the grid locale and labels.comments of the grid, then labels of the hook. locale sets the language of the comment times and follows the grid locale unless you set it.

LabelTypeUse
popover(columnTitle, cellText) => stringThe accessible name of the popover.
localestringThe locale of the comment times.
commentList, composer, editComposer, composerPlaceholderstringThe list, the label of the new-comment and edit textareas, and the placeholder.
submit, cancel, save, retry, discard, saveMinestringButton text.
editAction, deleteAction, confirmDeleteAction, resolveAction, reopenActionstringVisible action text.
edit, remove, confirmRemove, resolve, reopen(name, time) => stringThe accessible name of an action. name is "" for an anonymous comment.
resolved, saving, loading, loadFailed, changedByOther, noCommentsstringStatus text.
readOnlyHint, rowBusyHint, refused, failedstringHints and inline errors.
counter(used, max) => stringThe length counter near the limit.
menuItemstringThe context menu item.
announce, announceCount, announceAdded(count, unresolved, chord), (count, chord), (name)The live region text. announceCount replaces announce when enableResolve is false. chord is "" without a binding. name is "" for an anonymous comment.
unknownAuthorstringThe name of an author that has an id and no name.

DOM hooks

HookWhereUse
data-grid-comment-markerThe corner element of a commented cellStyle the marker. It is aria-hidden.
data-unresolvedThe markerPresent while any comment of the cell is unresolved. Absent on the ring.
data-grid-comments-popupThe popover popupStyle the popover. The grid ignores presses inside it.

The marker uses bg-primary and border-primary. Set --data-grid-comment-marker-inset on the grid (default 0px) to move the marker away from the end edge, for example under an overlay scrollbar. It stays visible in forced-colors mode. Under a coarse pointer, its hit area grows to 24 px, and the drawn corner stays the same. className merges into the popover root.

On this page