Delete Link on Child Page

Hey Tadabase community! I have (likely) my last custom solution to share with you this year. :slightly_smiling_face:

This method can be used to create a scenario where users can delete a record from the child detail or edit page for the given record. Upon deletion, the user is redirected back to the parent page.

For the full details on how to configure this in your app, please see this video.

Below you can find the code snippets mentioned in my video to either remove or modify the button icon.

CSS referenced @3:31 that hides the icon.

.btn-danger > .fa-check{
    display: none;
}

JavaScript referenced @3:41 that changes the icon. Be sure to change the component ID accordingly if you choose this option!

TB.render('component_4', function(data) {
	var icon = $('.btn-danger > .far');
	icon.addClass('fa-trash');
	icon.removeClass('fa-check');
});
1 Like

THANK YOU, Lee, for this!

Now (to look a gift horse in the mouth): Is it possible to add a confirmation dialog? I don’t know that I can use this process without either (a) a confirmation dialog and/or (b) an undo option.

William

Hey William! I haven’t done this before for a submit button, however, I recommend referring to Chem’s post here for reference on how you can add the confirmation for an action link. A similar method should be possible with the submit button as well.