-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
When the user clicks the "delete a node" button, sometimes we need to check first before completing the deletion. For example:
- pop an "are you sure?" to give the user a chance to back out if she clicked delete in error
- in the event deleting the backing item in a database or API fails
To allow for this, this feature request is for a new event treeNodeBeforeDelete
which allows the application to perform the check then indicate whether the delete should be allowed to continue. For example:
<tree-view ... @treeNodeBeforeDelete="onBeforeDelete" ...>
...
function onBeforeDelete(target) {
const answer = askAreYouSure() // prompts user, returns boolean
return answer
}
// OR
function onBeforeDelete(target) {
const answer = askAreYouSure()
if (answer === false) {
target.cancelDeletion() // or some other manipulation of the target node
}
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request