• 全选或不选


    html

    <table class="table" width="100%" cellpadding="0" cellspacing="0">
    <thead>
    <tr class="lineTh">
    <th width="30"><i class="checkIcon allCheckbox"></i></th>
    <th>接警值班员</th>
    <th>接警时间</th>
    <th>接警类型</th>
    <th>接警人姓名</th>
    <th>接警人联系方式</th>
    <th>船长</th>
    <th>联系电话</th>
    <th>船号</th>
    <th>带队领导</th>
    <th>出航时间</th>
    <th>受理处置</th>
    <th>移交</th>
    <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td><i class="checkIcon"></i></td>
    <td>马涛</td>
    <td>2017-12-12 09:56</td>
    <td>纠纷</td>
    <td>白泽郡</td>
    <td>15678898889</td>
    <td>秒永存</td>
    <td>18798767789</td>
    <td>苏赣渔0878</td>
    <td>刘勇参谋长</td>
    <td>2017-12-12 09:56</td>
    <td>调解处理</td>
    <td>渔政部门</td>
    <td>
    <a href="#" class="eye">查看</a>
    <a href="#" class="edit">编辑</a>
    <a href="#" class="delete">删除</a>
    </td>
    </tr>
    <tr>
    <td><i class="checkIcon"></i></td>
    <td>马涛</td>
    <td>2017-12-12 09:56</td>
    <td>纠纷</td>
    <td>白泽郡</td>
    <td>15678898889</td>
    <td>秒永存</td>
    <td>18798767789</td>
    <td>苏赣渔0878</td>
    <td>刘勇参谋长</td>
    <td>2017-12-12 09:56</td>
    <td>调解处理</td>
    <td>渔政部门</td>
    <td>
    <a href="#" class="eye">查看</a>
    <a href="#" class="edit">编辑</a>
    <a href="#" class="delete">删除</a>
    </td>
    </tr>
    <tr>
    <td><i class="checkIcon"></i></td>
    <td>马涛</td>
    <td>2017-12-12 09:56</td>
    <td>纠纷</td>
    <td>白泽郡</td>
    <td>15678898889</td>
    <td>秒永存</td>
    <td>18798767789</td>
    <td>苏赣渔0878</td>
    <td>刘勇参谋长</td>
    <td>2017-12-12 09:56</td>
    <td>调解处理</td>
    <td>渔政部门</td>
    <td>
    <a href="#" class="eye">查看</a>
    <a href="#" class="edit">编辑</a>
    <a href="#" class="delete">删除</a>
    </td>
    </tr>
    <tr>
    <td><i class="checkIcon"></i></td>
    <td>马涛</td>
    <td>2017-12-12 09:56</td>
    <td>纠纷</td>
    <td>白泽郡</td>
    <td>15678898889</td>
    <td>秒永存</td>
    <td>18798767789</td>
    <td>苏赣渔0878</td>
    <td>刘勇参谋长</td>
    <td>2017-12-12 09:56</td>
    <td>调解处理</td>
    <td>渔政部门</td>
    <td>
    <a href="#" class="eye">查看</a>
    <a href="#" class="edit">编辑</a>
    <a href="#" class="delete">删除</a>
    </td>
    </tr>
    <tr>
    <td><i class="checkIcon"></i></td>
    <td>马涛</td>
    <td>2017-12-12 09:56</td>
    <td>纠纷</td>
    <td>白泽郡</td>
    <td>15678898889</td>
    <td>秒永存</td>
    <td>18798767789</td>
    <td>苏赣渔0878</td>
    <td>刘勇参谋长</td>
    <td>2017-12-12 09:56</td>
    <td>调解处理</td>
    <td>渔政部门</td>
    <td>
    <a href="#" class="eye">查看</a>
    <a href="#" class="edit">编辑</a>
    <a href="#" class="delete">删除</a>
    </td>
    </tr>
    <tr>
    <td><i class="checkIcon"></i></td>
    <td>马涛</td>
    <td>2017-12-12 09:56</td>
    <td>纠纷</td>
    <td>白泽郡</td>
    <td>15678898889</td>
    <td>秒永存</td>
    <td>18798767789</td>
    <td>苏赣渔0878</td>
    <td>刘勇参谋长</td>
    <td>2017-12-12 09:56</td>
    <td>调解处理</td>
    <td>渔政部门</td>
    <td>
    <a href="#" class="eye">查看</a>
    <a href="#" class="edit">编辑</a>
    <a href="#" class="delete">删除</a>
    </td>
    </tr>
    <tr>
    <td><i class="checkIcon"></i></td>
    <td>马涛</td>
    <td>2017-12-12 09:56</td>
    <td>纠纷</td>
    <td>白泽郡</td>
    <td>15678898889</td>
    <td>秒永存</td>
    <td>18798767789</td>
    <td>苏赣渔0878</td>
    <td>刘勇参谋长</td>
    <td>2017-12-12 09:56</td>
    <td>调解处理</td>
    <td>渔政部门</td>
    <td>
    <a href="#" class="eye">查看</a>
    <a href="#" class="edit">编辑</a>
    <a href="#" class="delete">删除</a>
    </td>
    </tr>
    <tr>
    <td><i class="checkIcon"></i></td>
    <td>马涛</td>
    <td>2017-12-12 09:56</td>
    <td>纠纷</td>
    <td>白泽郡</td>
    <td>15678898889</td>
    <td>秒永存</td>
    <td>18798767789</td>
    <td>苏赣渔0878</td>
    <td>刘勇参谋长</td>
    <td>2017-12-12 09:56</td>
    <td>调解处理</td>
    <td>渔政部门</td>
    <td>
    <a href="#" class="eye">查看</a>
    <a href="#" class="edit">编辑</a>
    <a href="#" class="delete">删除</a>
    </td>
    </tr>
    <tr>
    <td><i class="checkIcon"></i></td>
    <td>马涛</td>
    <td>2017-12-12 09:56</td>
    <td>纠纷</td>
    <td>白泽郡</td>
    <td>15678898889</td>
    <td>秒永存</td>
    <td>18798767789</td>
    <td>苏赣渔0878</td>
    <td>刘勇参谋长</td>
    <td>2017-12-12 09:56</td>
    <td>调解处理</td>
    <td>渔政部门</td>
    <td>
    <a href="#" class="eye">查看</a>
    <a href="#" class="edit">编辑</a>
    <a href="#" class="delete">删除</a>
    </td>
    </tr>
    <tr>
    <td><i class="checkIcon"></i></td>
    <td>马涛</td>
    <td>2017-12-12 09:56</td>
    <td>纠纷</td>
    <td>白泽郡</td>
    <td>15678898889</td>
    <td>秒永存</td>
    <td>18798767789</td>
    <td>苏赣渔0878</td>
    <td>刘勇参谋长</td>
    <td>2017-12-12 09:56</td>
    <td>调解处理</td>
    <td>渔政部门</td>
    <td>
    <a href="#" class="eye">查看</a>
    <a href="#" class="edit">编辑</a>
    <a href="#" class="delete">删除</a>
    </td>
    </tr>
    </tbody>
    </table>

    js

    $(function(){
    //全选或全不选

    $(".allCheckbox").click(function() {
    if ($(this).hasClass('checked')) {
    $("tbody .checkIcon").removeClass('checked');
    } else {
    $(this).addClass('checked');
    $("tbody .checkIcon").addClass('checked');
    }
    });
    //设置全选复选框
    $("tbody .checkIcon").click(function() {
    $(this).toggleClass('checked');
    allchk();

    });

    });
    //设置全选复选框
    function allchk() {

    var chknum = $("tbody .checkIcon").size(); //选项总个数

    var chk = $("tbody .checked").length;

    if (chknum == chk) { //全选
    $(".allCheckbox").addClass('checked');
    } else { //不全选
    $(".allCheckbox").removeClass('checked');
    }
    }

  • 相关阅读:
    Oracle常用命令大全(很有用,做笔记)
    表格驱动编程在代码中的应用
    mac 利用svn下载远程代码出现Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
    FAILURE: Build failed with an exception.
    There is an internal error in the React performance measurement code.Did not expect componentDidMount timer to start while render timer is still in progress for another instance
    react native TypeError network request failed
    Android向系统相册中插入图片,相册中会出现两张 一样的图片(只是图片大小不一致)
    react-native Unrecognized font family ‘Lonicons’;
    react-native SyntaxError xxxxx/xx.js:Unexpected token (23:24)
    Application MyTest has not been registered. This is either due to a require() error during initialization or failure to call AppRegistry.registerComponent.
  • 原文地址:https://www.cnblogs.com/zhouyx/p/8125363.html
Copyright © 2020-2023  润新知