Heya, so ive got a ajax delete command tied into an ajax button and am trying to implement a confirm window on it, so the user clicks delete and it pops up asking them to confirm they want to delete it:
Anyone know how to tack that confirm onto the regular tabletools method?
{ "sExtends": "ajax", "bSelectedOnly": "true", "sButtonText": "Delete Selected", "mColumns": [0], "bHeader": false, "sAjaxUrl": "dataTable/delete/cmsGroup", "fnAjaxComplete": function ( XMLHttpRequest, textStatus ) { $('tr.DTTT_selected').remove(); }//delete button },now i hand wrote it out using a function call, but its MUCH more complex then the simple button is:
{ "sExtends": "text", "sButtonText": "Delete", "fnClick": function(nButton, oConfig, nRow){ if (confirm('Are you sure want to delete this record?')) { var list = $('tr.DTTT_selected > td.sorting_1 > a').map(function () { return this.text; }).get().join(","); $.ajax({ type: "POST", url: "dataTable/delete/cmsGroup", data: 'tableData='+ list, success: function(result) { alert("Entry Deleted"); $('tr.DTTT_selected').remove(); }}); }}},
Anyone know how to tack that confirm onto the regular tabletools method?