diff --git a/src/config/datatable.php b/src/config/datatable.php index c1e5eb51..4e0ff9c1 100644 --- a/src/config/datatable.php +++ b/src/config/datatable.php @@ -79,6 +79,8 @@ 'action' => 'ajax', 'method' => 'PATCH', 'label' => 'Action', + 'message' => 'Custom Action. Are you sure?', + 'confirmation' => true, ], ], 'row' => [ diff --git a/src/resources/assets/js/components/enso/vuedatatable/TableBody.vue b/src/resources/assets/js/components/enso/vuedatatable/TableBody.vue index ccb36819..0f62212a 100644 --- a/src/resources/assets/js/components/enso/vuedatatable/TableBody.vue +++ b/src/resources/assets/js/components/enso/vuedatatable/TableBody.vue @@ -197,7 +197,7 @@ export default { }, doAction(button, row) { if (this.modal) { - this.modal = false; + this.closeModal(); } if (button.event) { diff --git a/src/resources/assets/js/components/enso/vuedatatable/TopControls.vue b/src/resources/assets/js/components/enso/vuedatatable/TopControls.vue index 73907daf..fff24bb4 100644 --- a/src/resources/assets/js/components/enso/vuedatatable/TopControls.vue +++ b/src/resources/assets/js/components/enso/vuedatatable/TopControls.vue @@ -16,7 +16,7 @@ :class="button.class" :key="button.label" :href="button.action === 'href' ? button.path : null" - @click="doAction(button)"> + @click="button.confirmation ? showModal(button) : doAction(button)"> {{ i18n(button.label) }} @@ -74,6 +74,12 @@
+