From 9fcb0695e536f2137347462066c45022df91e190 Mon Sep 17 00:00:00 2001 From: Lawrence Ching Date: Wed, 10 Jul 2024 22:05:07 +0800 Subject: [PATCH] #387 describe "editable" events in document and demos --- docs/demos/15-editing/index.html | 4 ++++ docs/documentation/Events.md | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/docs/demos/15-editing/index.html b/docs/demos/15-editing/index.html index 14c18365..0bca5c1b 100644 --- a/docs/demos/15-editing/index.html +++ b/docs/demos/15-editing/index.html @@ -801,6 +801,10 @@

Editing

} ] }) + + table.on('editable.save.cell', (newValue, oldValue, row, column) => { + console.log(`cell is saved: newValue=${newValue}, oldValue=${oldValue}, row=${row}, column=${column}`) + }) } resetTable() document.getElementById("modal").addEventListener("input", _event => { diff --git a/docs/documentation/Events.md b/docs/documentation/Events.md index cc690c3f..8ee910a1 100644 --- a/docs/documentation/Events.md +++ b/docs/documentation/Events.md @@ -72,3 +72,18 @@ dataTable.on('datatable.sort', function(column, direction) { ### `datatable.update` Fires when the `.update()` method is called. + +### `editable.init` +Fires when the editor is initialized. + +### `editable.save.cell` +Fires when the cell is saved (even when the value is not actually updated). + +### `editable.save.row` +Fires when the row is saved. + +### `editable.context.open` +Fires when the context menu is opened. + +### `editable.context.close` +Fires when the context menu is closed. \ No newline at end of file