From 1c142f83a6b1efaa51d2f755fea704f54ab08694 Mon Sep 17 00:00:00 2001 From: mertsincan Date: Mon, 4 Oct 2021 11:08:47 +0300 Subject: [PATCH] Refactor Datatable doc and api-gen --- api-generator/components/datatable.js | 80 ++++++++++++++++++--------- src/views/datatable/DataTableDoc.vue | 6 ++ 2 files changed, 61 insertions(+), 25 deletions(-) diff --git a/api-generator/components/datatable.js b/api-generator/components/datatable.js index c8e4253bb..1093b5d2f 100644 --- a/api-generator/components/datatable.js +++ b/api-generator/components/datatable.js @@ -777,6 +777,21 @@ const DataTableEvents = [ type: "object", description: "Row data to edit." }, + { + name: "event.newData", + type: "object", + description: "New row data after editing." + }, + { + name: "event.value", + type: "object", + description: "Field value of row data to edit." + }, + { + name: "event.newValue", + type: "object", + description: "Field value of new row data after editing" + }, { name: "event.field", type: "string", @@ -836,30 +851,9 @@ const DataTableEvents = [ description: "Row data to edit." }, { - name: "event.field", - type: "string", - description: "Field name of the row data." - }, - { - name: "event.index", - type: "number", - description: "Index of the row data to edit." - } - ] - }, - { - name: "cell-edit-save", - description: "Callback to invoke when cell edit is saved.", - arguments: [ - { - name: "event.originalEvent", + name: "event.newData", type: "object", - description: "Browser event" - }, - { - name: "event.data", - type: "object", - description: "Row data to edit." + description: "New row data after editing." }, { name: "event.field", @@ -874,8 +868,8 @@ const DataTableEvents = [ ] }, { - name: "cell-edit-cancel", - description: "Callback to invoke when cell edit is cancelled.", + name: "row-edit-save", + description: "Callback to invoke when row edit is saved.", arguments: [ { name: "event.originalEvent", @@ -887,6 +881,42 @@ const DataTableEvents = [ type: "object", description: "Row data to edit." }, + { + name: "event.newData", + type: "object", + description: "New row data after editing." + }, + { + name: "event.field", + type: "string", + description: "Field name of the row data." + }, + { + name: "event.index", + type: "number", + description: "Index of the row data to edit." + } + ] + }, + { + name: "row-edit-cancel", + description: "Callback to invoke when row edit is cancelled.", + arguments: [ + { + name: "event.originalEvent", + type: "object", + description: "Browser event" + }, + { + name: "event.data", + type: "object", + description: "Row data to edit." + }, + { + name: "event.newData", + type: "object", + description: "New row data after editing." + }, { name: "event.field", type: "string", diff --git a/src/views/datatable/DataTableDoc.vue b/src/views/datatable/DataTableDoc.vue index f57315e41..cdc661722 100755 --- a/src/views/datatable/DataTableDoc.vue +++ b/src/views/datatable/DataTableDoc.vue @@ -2352,6 +2352,9 @@ export default { cell-edit-complete event.originalEvent: Browser event
event.data: Row data to edit.
+ event.newData: New row data after editing.
+ event.value: Field value of row data to edit.
+ event.newValue: Field value of new row data after editing.
event.field: Field name of the row data.
event.index: Index of the row data to edit.
event.type: Type of completion such as "enter", "outside" or "tab".
@@ -2369,6 +2372,7 @@ export default { row-edit-init event.originalEvent: Browser event
event.data: Row data to edit.
+ event.newData: New row data after editing.
event.field: Field name of the row data.
event.index: Index of the row data to edit.
Callback to invoke when row edit is initiated. @@ -2377,6 +2381,7 @@ export default { row-edit-save event.originalEvent: Browser event
event.data: Row data to edit.
+ event.newData: New row data after editing.
event.field: Field name of the row data.
event.index: Index of the row data to edit.
Callback to invoke when row edit is saved. @@ -2385,6 +2390,7 @@ export default { row-edit-cancel event.originalEvent: Browser event
event.data: Row data to edit.
+ event.newData: New row data after editing.
event.field: Field name of the row data.
event.index: Index of the row data to edit.
Callback to invoke when row edit is cancelled.