How to add Delete Functionality Inside a Modal

Please note that this is now available as a plugin for easier installation. While you can use this document as a reference, the recommended method to add…

  • Not yet re-checked
  • Classic builder

Moved from our previous help site and not yet re-checked against the current product. Last edited Sep 20, 2024.

Screenshot for “How to add Delete Functionality Inside a Modal”

Here’s a way to add the delete functionality inside an edit popup modal.

Step 1

Create a table with an “Edit” link.

Screenshot for “How to add Delete Functionality Inside a Modal”

Step 2

Add a custom component to the edit page.

Screenshot for “How to add Delete Functionality Inside a Modal”

Step 3

Add custom code to the template and JavaScript.

Template

Text
{{#each records}}

    </br>

    <p style="display:none;" id="id">{{id}}</p>

    <button class="btn btn-danger pull-left" id="delete"> Delete Record </button>

{{/each}}
Screenshot for “How to add Delete Functionality Inside a Modal”

JavaScript

Text
document.getElementById("delete").onclick = async function() {
    if (confirm("Are you sure you want to delete this session")) {
        var i = document.getElementById("id").innerText
        await deleteRecord("4YZjnDNPvl", i); // In this part add your delete function
        location.reload();

    }
};
Screenshot for “How to add Delete Functionality Inside a Modal”

Original Community Post:

How to add Delete Functionality inside a modal! - Community Discussions / Tips and Tricks - Tadabase Community

Was this page helpful?

Something wrong or missing on this page? Tell us.