当前位置: 代码迷 >> Java Web开发 >> jquery如何实现全选,全不选,删除功能
  详细解决方案

jquery如何实现全选,全不选,删除功能

热度:2837   发布时间:2016-04-10 23:55:09.0
jquery怎么实现全选,全不选,删除功能
  现在的问题是,我做的全选功能,当单个选择时,全选的状态不变false,还有删除的不会做,求大神帮忙,谢谢。



<script type="text/javascript">

//全选/全不选
 $("#checkAll").click(function(){
      if(this.checked){
     $("input[name='pkId']").attr("checked","checked");
  }else{
     $("input[name='pkId']").attr("checked",null);
  }
   }); 
//反选
// $("#checkAll").click(function(){
//      $("input[name='pkId']").each(function(index,DomEle){
//     if(DomEle.checked){
//   $(DomEle).attr("checked",null);
//  }else{
//   $(DomEle).attr("checked","checked");
//  }
//   });



});








</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">

<jsp:include page="public/head.jsp"></jsp:include>

<table width="900" border="0" cellspacing="0" cellpadding="0" height="172" align="center" bgcolor="#FFFFFF" class="index_body">
  <tr>
    <td valign="top"> 
      <table width="882" border="0" cellspacing="0" cellpadding="0" height="11" align="center">
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
      <table width="882" border="0" cellspacing="0" cellpadding="0" align="center">
      </table>
      <s:form action ="/composite/myIssueAcction_findmyissueUIfoByCondition.action"
method="POST" id="findmyissueUIfoByCondition1">
<div align="center">
        <table width="882" border="0" cellspacing="0" cellpadding="0" height="47" background="${basePath }/global/images/portal/wdff.jpg">
          <tr> 
            <td width="538">&nbsp;</td>
            <td width="288" valign="bottom" align="right"> 
              <s:textfield id = "d1" name="productName" cssClass="input" size="32" value="%{paroductName}"/>
            </td>
            <td width="52"  valign="bottom" height="29">
            <img src="${basePath }/global/images/portal/search.png" id ="findmyissueUIfoByCondition2"  onclick="search()" style="cursor:pointer">
            </td>
          </tr>
        </table>
      </div>
       </s:form>
      <table width="882" border="0" cellspacing="0" cellpadding="0" align="center"  class="fwld_2">
        <tr> 
          <td colspan="2">&nbsp; </td>
        </tr>
        <tr> 
          <td width="155" valign="top"> 
            <div align="center" style="height:15;background:url(${basePath }/global/images/portal/cpzs_left1.jpg) no-repeat"></div>
            <table width="150" style="height:126;background:url(${basePath }/global/images/portal/cpzs_left2.jpg) no-repeat" >
              <tr> 
                <td height="45"> 
                  <div align="center"><a href="${pageContext.request.contextPath}/composite/myIssueAcction_myissueUI.action"><img src="${basePath }/global/images/portal/wdff_1.jpg" width="127" height="23" border="0" ></a></div>
                </td>
              </tr>
              <tr> 
                <td> 
  相关解决方案