Hey guys. I am somewhat new to jQuery and javascript in general. What I have is a CMS that I am upgrading. In doing so, I have started an option to delete multiple categories at once via checkboxes, which is processed via jquery/ajax.
In deleting the records individually, I could remove the row of the table once deleted, but now with multiple records and checkboxes, I am not quite sure how to handle this. If it helps at all, this is what I am working with (excuse if it's messy, I am not too familiar with JS or jQuery in general)...
// Process deleting multiple categories
$("#delete_selected").click(function() {
$("#delete_loading").fadeIn("slow");
var bool = confirm('Are you sure you want to delete the selected categories? This action cannot be undone.');
if (bool == true)
{
var formDataString = $("#categoriesForm").serialize();
$.ajax({
type: "POST",
url: domain + "/admin/categories/delete_category/",
data: formDataString,
cache: false,
dataType: "html",
success: function() {
$("#delete_loading").fadeOut("slow");
$('tr#' + id).fadeOut("slow");
$('tr#' + id + ' td').fadeOut("slow");
},
error: function() {
$("#delete_loading").fadeOut("slow");
$('#error').fadeIn("slow");
}
});
}
else { $('#error').show(); }
return false;
});
Thanks for any help or thoughts you can offer. As you can see, in the old code I just faded the table rows after processing, but have no idea how to return the ID's to hide from PHP (I am also using Kohana framework).