jquery批量删除

<%@pagelanguage="java"import="java.util.*"pageEncoding="UTF-8"%>

<%@taglibprefix="s"uri="/struts-tags"%>

<%

Stringpath=request.getContextPath();

StringbasePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN">

<html>

<head>

<basehref="<%=basePath%>">

<title>MyJSP'index.jsp'startingpage</title>

<metahttp-equiv="pragma"content="no-cache">

<metahttp-equiv="cache-control"content="no-cache">

<metahttp-equiv="expires"content="0">

<metahttp-equiv="keywords"content="keyword1,keyword2,keyword3">

<metahttp-equiv="description"content="Thisismypage">

<linkrel="stylesheet"href="conf/themes/default/easyui.css"type="text/css"media="screen"/>

<linkrel="stylesheet"href="conf/themes/icon.css"type="text/css"media="screen"/>

<scriptsrc="conf/js/jquery-1.3.2.min.js"></script>

<scriptsrc="conf/js/jquery.easyui.min.js"></script>

<scriptsrc="conf/js/easyui-lang-zh_CN.js"></script>

<SCRIPTtype="text/javascript">

$(function(){

//全选与全不选

$("#ckall").click(function()

{

$("[name=ck]:checkbox").attr("checked",this.checked);

});

varobjs=$("[name=ck]:checkbox");

//当一个个的全部选中的时候全选的按钮也是需要选中的

objs.click(function(){

$("#ckall").attr("checked",objs.length==objs.filter(":checked").length);

});

//批量删除

$("#largeDel").click(function(){

varstr="";

$.each($("input[type='checkbox'][id!=all]"),function(k,v){

if(v.checked==false)

{

return;

}

else

{

str+=v.value+",";

}

});

if(str=="")

{

alert("请选中一项");

return;

}

elseif(confirm("确认删除吗?"))

{

str=str.substring(0,str.length-1);

alert(str);

//window.location.href="ideLogin.action?ids="+str;

}

});

});

</SCRIPT>

</head>

<body>

<buttonid="largeDel">删除</button>

<P>

<inputtype="checkbox"id="ckall"value="all"/>全选</P><P>

<inputtype="checkbox"name="ck"value="0"/>男</P><P>

<inputtype="checkbox"name="ck"value="1"/>女</P><P>

<inputtype="checkbox"name="ck"value="00"/>百合</P><P>

<inputtype="checkbox"name="ck"value="11"/>基友</P>

<s:checkboxname="ck"value="false"fieldValue="1111">通吃</s:checkbox>

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

ThisismyJSPpage.fffffffffffffffffffffffffffffff<br>

====================循环request中的list对象(super.getRequest().setAttribute("listUsers",getAllListUsers);)==========================

<br>

<s:iteratorvalue="#request.listUsers"status="s"id="key">

<s:propertyvalue="userName"/>&nbsp;

<s:propertyvalue="passwd"/>&nbsp;

</s:iterator>

<br>

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

======================LoginAction中的listMap是属性循环出里面的对象=====================================

<br>

<s:iteratorvalue="listMap"status="s"id="list">

属性listMap中key=<s:propertyvalue="key"/>&nbsp;

下面是属性listMap中value(但是每一个Value是一个List对象List对象中放置的LoginBean对象)=

<s:propertyvalue="value"/>&nbsp;

<s:iteratorvalue="value"status="s"id="key">

<s:propertyvalue="userName"/>&nbsp;

<s:propertyvalue="passwd"/>&nbsp;

</s:iterator>

</s:iterator>

<br>

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

<br>&nbsp;

==================循环request中requestListMap的对象(super.getRequest().setAttribute("requestListMap",LoginService.getAllUsers());)============================================

<br>

<s:iteratorvalue="#request.requestListMap.keySet()"id="key">

<s:propertyvalue="key"/>

<s:iteratorvalue="#request.requestListMap.get(#key)"id="loginBean"status="loginBean_stat">

<tr>

<s:iftest="#cust_stat.odd==true">odd</s:if><s:else>even</s:else>

<td><s:propertyvalue="userName"/>&nbsp;</td>

<td><s:propertyvalue="passwd"/>&nbsp;</td>

</tr>

</s:iterator>

</s:iterator>

</body>

</html>

相关推荐