通过id批量删除
1.页面js写法
//删除
function deleteWebsites(){
var length = $("input[name='checkbox']:checked").length;
if (length == 0) {
tips_alert("请选择删除选项!");
return false;
}
tips_confirm("您确定要删除所选网点?",function(){
var websiteIds = [];
$("input[name='checkbox']:checked").each(function() {
websiteIds.push($(this).val());
});
$.ajax({
type : "post",
url : "${ctx}/website/auth/deleteWebsites.do",
data : {
"websiteIds" : websiteIds.toString()
},
dataType : "json",
success : function(data) {
if (data.success) {
tips_alert("删除成功!",function(){
queryWebsites();
});
} else {
tips_alert("删除失败!");
}
}
});
});
}
2.jsp页面情况
<div class="rlist-tright pull-right clearfix">
<ul>
<li><a href="javascript:void(0);" οnclick="deleteWebsites()">删除</a></li>
<li><a href="javascript:toPage('/website/auth/toPublishWebsitePage.do', 'PISP_M_PUBLISH_INFO', 'PISP_M_PUBLISH_NETPOINT');">发布网 点</a></li>
</ul>
</div>
<table width="810" border="0" cellspacing="0" cellpadding="0" class="my-tab">
<thead>
<tr>
<td width="44" height="42" align="center" class="border-bottom border-right">选项</td>
<td width="160" align="center" class="border-bottom border-right">网点名称</td>
<td width="100" align="center" class="border-bottom border-right">联系人</td>
<td width="100" align="center" class="border-bottom border-right">手机号码</td>
<td width="250" align="center" class="border-bottom border-right">详细地址</td>
<td align="center" class="border-bottom border-right">操作</td>
</tr>
</thead>
<c:forEach items="${result.queryList}" var="website">
<tr>
<td align="center" class="border-bottom border-right tab-pad"><input type="checkbox" name="checkbox" value="${website.id}"></td>
<td align="center" class="border-bottom border-right tab-pad">${website.outletsName}</td>
1.页面js写法
//删除
function deleteWebsites(){
var length = $("input[name='checkbox']:checked").length;
if (length == 0) {
tips_alert("请选择删除选项!");
return false;
}
tips_confirm("您确定要删除所选网点?",function(){
var websiteIds = [];
$("input[name='checkbox']:checked").each(function() {
websiteIds.push($(this).val());
});
$.ajax({
type : "post",
url : "${ctx}/website/auth/deleteWebsites.do",
data : {
"websiteIds" : websiteIds.toString()
},
dataType : "json",
success : function(data) {
if (data.success) {
tips_alert("删除成功!",function(){
queryWebsites();
});
} else {
tips_alert("删除失败!");
}
}
});
});
}
2.jsp页面情况
<div class="rlist-tright pull-right clearfix">
<ul>
<li><a href="javascript:void(0);" οnclick="deleteWebsites()">删除</a></li>
<li><a href="javascript:toPage('/website/auth/toPublishWebsitePage.do', 'PISP_M_PUBLISH_INFO', 'PISP_M_PUBLISH_NETPOINT');">发布网 点</a></li>
</ul>
</div>
<table width="810" border="0" cellspacing="0" cellpadding="0" class="my-tab">
<thead>
<tr>
<td width="44" height="42" align="center" class="border-bottom border-right">选项</td>
<td width="160" align="center" class="border-bottom border-right">网点名称</td>
<td width="100" align="center" class="border-bottom border-right">联系人</td>
<td width="100" align="center" class="border-bottom border-right">手机号码</td>
<td width="250" align="center" class="border-bottom border-right">详细地址</td>
<td align="center" class="border-bottom border-right">操作</td>
</tr>
</thead>
<c:forEach items="${result.queryList}" var="website">
<tr>
<td align="center" class="border-bottom border-right tab-pad"><input type="checkbox" name="checkbox" value="${website.id}"></td>
<td align="center" class="border-bottom border-right tab-pad">${website.outletsName}</td>