嘿家伙。一般来说,我对jQuery和JavaScript有点新鲜。我所拥有的是我正在升级的CMS。在这样做的时候,我已经启动了一个选项,通过复选框一次删除多个类别,通过jquery/ajax处理。jQuery + PHP:从多个ID中删除表中的行
在单独删除记录时,我可以删除表中的行,但现在有多个记录和复选框,但我不太清楚如何处理这个问题。如果有帮助可言,这就是我一起工作(借口,如果它的混乱,我不是太熟悉JS或jQuery的一般)...
// 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;
});
感谢任何帮助或想法,你可以提供。正如你所看到的,在旧代码中,我只是在处理后淡化了表行,但不知道如何返回ID来隐藏PHP(我也使用Kohana框架)。
演示页面将在这里有所帮助。 – Wayne 2010-08-17 02:16:52