惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
J
Java Code Geeks
雷峰网
雷峰网
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
云风的 BLOG
云风的 BLOG
V
Visual Studio Blog
V
Vulnerabilities – Threatpost
S
Securelist
The Hacker News
The Hacker News
The Register - Security
The Register - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
G
Google Developers Blog
Hugging Face - Blog
Hugging Face - Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
AI
AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The GitHub Blog
The GitHub Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Schneier on Security
Schneier on Security
N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Hacker News: Front Page
博客园 - 司徒正美
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
大猫的无限游戏
大猫的无限游戏
Security Latest
Security Latest
Engineering at Meta
Engineering at Meta
N
News and Events Feed by Topic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Threat Research - Cisco Blogs
U
Unit 42
V
V2EX
V2EX - 技术
V2EX - 技术
L
LINUX DO - 最新话题
aimingoo的专栏
aimingoo的专栏
Microsoft Security Blog
Microsoft Security Blog
Recorded Future
Recorded Future
P
Privacy & Cybersecurity Law Blog
美团技术团队
小众软件
小众软件
F
Fortinet All Blogs

博客园 - 愛如風過

MODRD 指令 读取地址是哪儿来的 如何在不同编程语言中获取现在的Unix时间戳(Unix timestamp)? easyui datagrid 的分页刷新按钮 HttpRequest Get Post,WebClient Get GetWindowThreadProcessId用法(转) Android Service 数据库主键设计之思考[转] Silverlight 使用用户控件 [转] - 愛如風過 技巧:在Silverlight 2应用程序中切换用户控件[转] Jquery 实现“最近浏览过的商品”的功能 - 愛如風過 - 博客园 Jquery获取设置radio select checkbox 文本框 [转] - 愛如風過 泛型 Vista 中,使用VS 2005调试程序没有权限的问题? Team Foundation 和 Visual SourceSafe 之间的区别 MSF资源 网页左右浮动广告(包括ASP.NET后台管理) why? 在水晶报表中实现任意选择指定字段显示资料 .在Datagrid中修改数据,当点击编辑键时,数据出现在文本框中,怎么控制文本框的大小 ?(转)
EASYUI DATAGRID 多列复选框CheckBox
愛如風過 · 2014-03-19 · via 博客园 - 愛如風過

主要实现:

用的 easyui 1.3.2

实现多个复选框列,各列互不影响。能够实现全选。主要部门用红色标记了的。

easyui datagrid 初始化:

<script>
function initTableGMAL() { $("#dg_gmal").datagrid({ url: "/Manager/PublishManager/ashx/MALOP.ashx?action=search", idField: 'MAL_ID', fit: false, fitColumns: true, singleSelect: true, width: 637, height: 280, rownumbers: true, nowrap: true, pagination: false, checkOnSelect: false, selectOnCheck: false, columns: [[ { field: 'MAL_ZHName', title: '属性', width: 200, align: 'center' } , { field: 'op1', title: ' 明细中显示:', width: 70, align: 'right' }, { field: 'op11', title: '
<input id=\"detailcheckbox\" type=\"checkbox\" >', width: 30, formatter: function (value, rec, rowIndex) { return "<input type=\"checkbox\" name=\"PD\" value=\"" + rec.MAL_ID + "\" >"; } }, { field: 'op2', title: '列表中显示:', width: 70, align: 'right' }, { field: 'op22', title: '<input id=\"listcheckbox\" type=\"checkbox\" >', width: 30, formatter: function (value, rec, rowIndex) { return "<input type=\"checkbox\" name=\"PL\" value=\"" + rec.MAL_ID + "\" >"; } } ]], onLoadSuccess: function () { $("#detailcheckbox").unbind(); $("#listcheckbox").unbind();
$("input[name='PL']").unbind().bind("click", function () { //总记录数 var totolrows = $("input[name='PL']").length; //选中的记录数 var checkrows = $("input[name='PL']:checked").length; //全选 if (checkrows == totolrows) { $("#listcheckbox").attr("checked", 'checked'); } else { $("#listcheckbox").removeAttr("checked"); }
$("#pllist").val(""); var items = $("input[name='PL']:checked"); var result = ""; $.each(items, function (index, item) { result = result + "|" + item.value; }); $("#pllist").val(result); }); $("input[name='PD']").unbind().bind("click", function () { //总记录数 var totolrows = $("input[name='PD']").length; //选中的记录数 var checkrows = $("input[name='PD']:checked").length; if (checkrows == totolrows) { $("#detailcheckbox").attr("checked", 'checked'); } else { $("#detailcheckbox").removeAttr("checked"); } $("#pdlist").val(""); var items = $("input[name='PD']:checked"); var result = ""; $.each(items, function (index, item) { result = result + "|" + item.value; }); $("#pdlist").val(result); }); //全选 $("#detailcheckbox").click(function () { if ($(this).attr('checked') == 'checked') { $("input[name='PD']").attr("checked", 'checked'); } else { $("input[name='PD']").removeAttr("checked"); } $("#pdlist").val(""); var items = $("input[name='PD']:checked"); var result = ""; $.each(items, function (index, item) { result = result + "|" + item.value; }); $("#pdlist").val(result); }); $("#listcheckbox").click(function () { if ($(this).attr('checked') == 'checked') { $("input[name='PL']").attr("checked", 'checked'); } else { $("input[name='PL']").removeAttr("checked"); } $("#pllist").val(""); var items = $("input[name='PL']:checked"); var result = ""; $.each(items, function (index, item) { result = result + "|" + item.value; }); $("#pllist").val(result); }); } }); }

 </script>

保存选中的行:

<div style="padding: 15px; overflow: hidden">
    <form id="f_package_general" method="post">

        <table class="tableForm" style="width: 100%; margin-left: 2px;">
     
            <tr>
                <td style="width: 80px;">显示配置:</td>
                <td colspan="3" style="height: 280px;">
                    <table id="dg_gmal">
                    </table>
                </td>
            </tr>
        </table>
        <input type="hidden" id="pdlist" name="pdlist" value="">
        <input type="hidden" id="pllist" name="pllist" value="">
       
    </form>
</div>