• 全选,反选


     1     //反选、计算
     2       function trCheck(id,name,obj){
     3         if($("input[name='check']").length== $("input[name='check']:checked").length){
     4            $("input[name='all-check']").attr("checked",true)
     5         }else{
     6             $("input[name='all-check']").attr("checked",false)
     7         }
     8 //         if( $("input[name='check']").length== $("input[name='check']:not(:checked)").length){
     9 //           $("input[name='all-check']").attr("checked",false)
    10 //         }
    11         if($(obj).attr("checked")=='checked'){
    12             window.parent.getpageName(id,name);
    13         }else{
    14             window.parent.remveData(id,name);
    15         }
    16      }
     1                 <table class="table table-bordered">
     2                                 <thead>
     3                                     <tr>
     4                                         <th>
     5                                             <div class="checkbox checkbox-danger">
     6                                                 <input type="checkbox" name="all-check" class="styled" onclick="selectCheck(this)"/>
     7                                                 <label class="checkbox-inline"></label>
     8                                             </div>
     9                                         </th>
    10                                         <th>姓名</th>
    11                                         <th>性别</th>
    12                                         <th>手机</th>
    13                                         <th>职务</th>
    14                                     </tr>
    15                                 </thead>
    16                                 <tbody>
    17                                     <c:forEach items="${page.list}" var="voterRegister" varStatus="var">
    18                                         <tr id="my">
    19                                             <th scope="row">
    20                                                 <div class="checkbox checkbox-danger">
    21                                                     <input type="checkbox" name="check" value="${voterRegister.id},${voterRegister.name}"   onclick="trCheck('${voterRegister.id}','${voterRegister.name}',this)" class="styled" rowid="${voterRegister.id}"/>
    22                                                     <label class="checkbox-inline"></label>
    23                                                 </div>
    24                                             </th>
    25                                             <%-- <td style="cursor:pointer;"  onclick="appendName('${voterRegister.id}','${voterRegister.name}')">${voterRegister.name}</td>
    26                                             <td style="cursor:pointer;"  onclick="appendName('${voterRegister.id}','${voterRegister.name}')">${voterRegister.colA}</td> --%>
    27                                             <td style="cursor:pointer;">${voterRegister.name}</td>
    28                                             <td style="cursor:pointer;">${fns:getDictLabels(voterRegister.sex, "sex", "未填写")}</td>
    29                                             <td>${voterRegister.phone}</td>
    30                                             <td>${voterRegister.occupation}</td>
    31                                         </tr> 
    32                                     </c:forEach>
    33                                 </tbody>
    34                             </table>
  • 相关阅读:
    CodeForces 955D
    C# 基础复习三 C#7
    C#各版本新功能 C#7.3
    同步基元概述
    C#各版本新功能 C#7.1
    C#各版本新功能 C#6.0
    C#各版本新功能 C#7.0
    js加载事件和js函数定义
    java.sql.SQLException: Access denied for user 'root '@'localhost' (using password: YES) 最蠢
    消息管理-activemq
  • 原文地址:https://www.cnblogs.com/mxggx/p/13992868.html
Copyright © 2020-2023  润新知