/*批量删除*/
function datadel(url) {
var ids=[];
$("input[type='checkbox']:checked").each(function () {
var id=$(this).parent().next().text();
if(id!="ID"){
ids.push(id);
}
});
console.log("-=-----------1"+JSON.stringify(ids));

layer.confirm('确认要删除多条记录吗?',function(index){
$.ajax({
type: 'POST',
url:url,
// dataType: 'json',
contentType : "application/json" ,
data:JSON.stringify(ids),
success: function(data){
if(data>0){
layer.msg('已删除!',{icon:1,time:1000});
}

},
error:function(data) {
console.log(data.msg);
},
});
});

}

[Controller]
@RequestMapping(value = "/deleteAll", method = {RequestMethod.POST})
@ResponseBody
public Object testPost(@RequestBody String[] ids) throws IOException {
for (String string : ids) {
System.out.println(string);
}
return 1;
}

相关文章:

  • 2022-01-31
  • 2021-08-20
  • 2022-01-26
  • 2021-06-04
  • 2022-12-23
  • 2022-01-14
  • 2021-12-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-24
  • 2021-08-07
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案