Data Change History Buttons

View as Markdown

Summary

  • Buttons can be added to Data Change History Monitor

The changeHistoryButton property in Data Change History Options allows developers to provide custom button(s) on each row of the Data Changes Monitor.

Note

When buttons are configured, AdapTable adds an Action Column in the monitor grid

You can wire buttons for undo, clear, or fully custom behaviour.

changeHistoryButton

Action Button to display in each row in Data Changes Monitor - can implement undo functionality

Button Actions

Data Change History buttons often perform one of two actions:

  • Undo — revert the data change shown on the row
  • Clear — remove the row from the monitor so it is no longer visible (grid data unchanged)

AdapTable provides built-in action values 'undo' and 'clear'.

Data Change History: Button Actions
Fork
  • Two buttons in adaptableOptions.ts: action: 'undo' and action: 'clear'
  • Undo uses a dynamic label for group rows (Undo Group vs Undo)
Try It Out
  • Make an edit, open the monitor, and try Undo and Clear
Loading demo…

Undo Button

Alternatively, use a custom onClick and call the context helpers yourself.

For example, you might notify a backend before undoing, or highlight the affected cell on the main grid before calling context.undoDataChange().

Note

  • You do not need to implement undo logic
  • undoDataChange() and clearRow() on DataChangeHistoryContext delegate to AdapTable
Data Change History: Undo Button
Fork
  • Single custom button in adaptableOptions.ts that calls context.undoDataChange() from onClick
Try It Out
  • Edit a cell, open the monitor, and use Undo
Loading demo…