This module gets a model row by key value and renders a tree of all the data that depend to the row. It can also delete the row and all the dependent data.
Unpack the downloaded file.
Put ConfirmDelete.php inside the application factories directory.
Put confirm-delete.css inside the CSS directory.
Edit URL to factory map file and add two mappings to ConfirmDelete.render and ConfirmDelete.delete like below:
<route path="/DeleteConfirm/render/:modelGroup/:modelClass/:id" factory="DeleteConfirm.render" robots="false" ajax="true" permission="true" /> <route path="/DeleteConfirm/delete/:action/:key" factory="DeleteConfirm.delete" robots="talse" ajax="true" permission="true" />
Add CSS file to browser dictionary (optional):
<style name="delete-confirm" path="BASE_URL/css/delete-confirm.css" compress="APP_DIR/browser/resources/css/delete-confirm.css" />
Arta.deleteConfirm(model-row-id, 'model-group-name', 'model-class-name');
This will show the dependencies inside the message box. To show the contents inside another container change the default message box:
Arta.msgBox = 'confirm-delete-container'; Arta.deleteConfirm(model-row-id, 'model-group-name', 'model-class-name'); Arta.msgBox = 'msg-box';
When not using "arta.js" send AJAX requests to the ConfirmDelete.render and ConfirmDelete.delete factories.
Edit and customize ConfirmDelete.php and confirm-delete.css. Make sure the CSS will be loaded.