Forum


Table Manager Support

Table Manager Support
Forums
Public write access is disabled. Please login

Delete Confirmation 24.11.2014 10:45

What is the best way to add a "Delete Confirmation" window or option rather than simply having a record delete upon clicking the X icon. Users now-a-days are used to having an ARE YOU SURE? option.

Re: Delete Confirmation 24.11.2014 11:06

Hello,

You could add a confirm javascript code at JOOMLA/components/com_mstablemanager/assets/js/tablemanager.js, line 338, replacing '$(this).find('.tmremovelink').click' event code like this:


$(this).find('.tmremovelink').click(function(event){
var delconfirm = confirm("Are you sure!");
if (delconfirm == true) {
event.stopPropagation();
tmajaxstart();
var idRow=$(this).closest('tr').find('input[type=hidden][name=tmrid]').val();
$(TM.anchor).find('#tmform').find('input[name="task"]').val('tmdelete');
$(TM.anchor).find('#tmform').find('input[name="rowid"]').val(idRow);
$.post("index.php", $(TM.anchor).find('#tmform').serialize())
.done(function(data) {
TM.tmtable.createHeaderContent();
tmajaxend();
});
}
});

Hope this helps. Regards,
Moonsoft Team
www.moonsoft.es

Re: Delete Confirmation 24.11.2014 19:09

Was a little further up from line 338 but it worked perfect! Thanks!
Are you satisfied with our products/services/support?
Please help us to keep improving, add a review at  joomla extensions site and  magento connect
FaLang translation system by Faboba

Our clients' feedback