js怎么删除分页数据,请大神帮忙。

   阅读
js如何删除分页数据,请大神帮忙。急!在线等
我现在数据库里一共有30条数据,页面分3页,没页10条.我现在想一键删除这30条数据,用js如何实现?下面的代码还是只能删除10条.求解!
function goDeleteAll(){
var pages= $("totalPages").value; 
for(var j=pages;j>0;j--){
var nodes = document.getElementsByName("itemId");
var ids = null;
for(var i=0;i<nodes.length;i++){
nodes[i].checked=true;
if(nodes[i].checked){
if(ids == null){
ids = nodes[i].value;
}else{
ids = ids + ","+ nodes[i].value;
}
}
//调用删除方法
c_warn_configInfoService.deleteWarnConfigInfo(ids,callBackResult);
}
if(ids == null){
alert(message_sl_choose_one_atList);
return;
}
  
  }

}


//删除记录后的回调方法
function callBackResult(data){
//可以显示data的信息
parent.queryForm.submit();

------解决方案--------------------
你后台写一个sql语句就是嘛,
delete from table_name

你的前台只要发送响应的参数就行了,需要这么复杂吗?
------解决方案--------------------
想全删就别传ID了,去数据库,delete * 呀
------解决方案--------------------
引用:
Quote: 引用:

你后台写一个sql语句就是嘛,
delete from table_name

你的前台只要发送响应的参数就行了,需要这么复杂吗?


我的分页数据是通过查询条件查询某张表的部分数据


你的意思是说你的分页语句可能是下面这种类似的(我只是举个例子):

  select name,age,sex from user where age>10 limit 1,10

那么你的delete语句可以下城下面类似的

delete from user where age in ( select name,age,sex from user where age>10 limit 1,10);

你看这样满足你的条件吗?
阅读