Browse Source

add 'delete row' and 'duplicate row' buttons to edit overaly - WIP

pull/4898/head
Daniel Spaude 2 years ago
parent
commit
f6ec8f1ac7
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 16
      packages/nc-gui/components/smartsheet/expanded-form/Header.vue

16
packages/nc-gui/components/smartsheet/expanded-form/Header.vue

@ -79,10 +79,19 @@ const { deleteRowById } = useViewData(meta, ref(props.view))
const duplicateRow = () => alert('duplicateRow') const duplicateRow = () => alert('duplicateRow')
const onDeleteRowClick = async () => { const showDeleteRowModal = ref(false)
const onDeleteRowClick = () => {
// alert('deleteRow') // alert('deleteRow')
showDeleteRowModal.value = true
}
const onConfirmDeleteRowClick = async () => {
showDeleteRowModal.value = false
await deleteRowById(primaryKey.value) await deleteRowById(primaryKey.value)
reloadTrigger.trigger() reloadTrigger.trigger()
emit('cancel')
message.success('Row deleted')
// loadData() // loadData()
// deleteRow // deleteRow
} }
@ -93,7 +102,6 @@ const onDeleteRowClick = async () => {
// await deleteRowById(primaryKey) // await deleteRowById(primaryKey)
// loadData() // loadData()
// } // }
</script> </script>
<template> <template>
@ -171,6 +179,10 @@ const onDeleteRowClick = async () => {
{{ $t('activity.duplicateRow') }} {{ $t('activity.duplicateRow') }}
</div> </div>
<a-modal v-model:visible="showDeleteRowModal" title="Delete row?" @ok="onConfirmDeleteRowClick">
<p>Are you sure you want to delete this row?</p>
</a-modal>
<div v-e="['a:actions:download-excel']" class="nc-menu-item" @click="onDeleteRowClick"> <div v-e="['a:actions:download-excel']" class="nc-menu-item" @click="onDeleteRowClick">
<MdiDelete class="text-gray-500" /> <MdiDelete class="text-gray-500" />
{{ $t('activity.deleteRow') }} {{ $t('activity.deleteRow') }}

Loading…
Cancel
Save