Configuring Comments

Summary

  • Developers can configure which Cells in the Grid are able to receive Comments
  • And like everything in AdapTable, Comments can be easily themed using CSS Variables

Comments are not available or enabled by default in AdapTable.

Instead, they need to be explicitly enabled and set up by developers at design time.

Note

Comments uses a very similar loading and persisting pattern as Team Sharing

Developer Guide

Setting up Comments

Commentable Cells

By default all cells in AG Grid - even readonly ones - can receive a Comment.

But developers are able to use the isCellCommentable property in Comment Options to specify on a cell by cell basis whether or not a Comment can be added.

Configuring Commentable Cells
Fork
  • This example contains an implementation for the isCellCommentable property in Comment Options which prevents Comments from being added to Cells:
    • in the Language Column
    • in Rows where the value in the License Column is "Other"

Expand to see the function implementation

Theming Comments

By default the triangle in a cell to denote a Comment is painted blue.

Note

Technically AdapTable uses the value of the --ab-color-info variable, which itself can be overridden

However, like everything theming-related in AdapTable, this can be overridden using CSS Variables.

All that is required is to provide a different value for the --ab-CellComment-triangle-color CSS variable.

Comments CSS
Fork
  • In this demo we have overridden the --ab-CellComment-triangle-color CSS Variable so that the Notes triangle appears as yellow

Expand to see the CSS provided

Date Format

AdapTable provides a property to configure how the timestamp of a Comment is displayed.

Note

This is used in both the Comment itself and the Commments screen that shows all current Comments

The property is available in Comment Options and returns a string (optionally via a function).

dateFormat

Default: dd-MM-yyyy HH:mm:ss
String
Date Format to use for timestamp in Comments
Comments Date Format
Fork
  • In this demo we provide a custom Date Format of 'MMM do yyyy' which is used when displaying the Timestamp in Comments

Expand to see the Comment Option provided