Data Change History Buttons

Summary

  • Buttons can be added to Data Change History Monitor

Change History Button

The Data Change History Options also includes a changeHistoryButton property.

This allows developers to provide their own, custom, Button(s) where additional functionality is required.

Note

When this button is provided, AdapTable automatically displays an Action Column to contain these buttons

You can then wire up these Buttons to perform custom actions (e.g. 'Undo' or 'ShowMe')

changeHistoryButton

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

Button Actions

Data Change History Buttons are often used to perform 2 actions:

  • Undo the data change which is being displayed
  • Clear the row in the Change History Monitor so its no longer visible

For this reason AdapTable provides 2 associated convencience Actions - Undo and Clear.

These actions can be attached directly to the Button and AdapTable will perform the necessary actions.

Data Change History: Button Actions
Fork
  • This demo showcases Data Change History with 2 Buttons - each attached to an Action
    • The Undo button is wired to the undo action
    • The Clear button is wired to the clear action

Expand to see the Action Buttons provided

Undo Button

Alternatively, developers might want to provide their own Undo button implementation.

For instance, instead of undoing the edit directly they might want to send it to a backend process to manage, or becasue they want to illustrate the changed cell in the Grid in some way.

The actual undo functionality itself does not need to be provided since AdapTable includes a very helpful undoDataChange() function property in the Context object.

Data Change History: Undo Button
Fork
  • This demo showcases Data Change History with an Undo Button
  • We call context.undoDataChange() in the button's onClick property to effect the change

Expand to see the Button provided