layui table中使用checkbox
第一步:
1.
<div class="layui-form">
<table class="layui-hide" lay-filter="js_table_reource_invite_supplier_index_table" id="js_table_reource_invite_supplier_index_table"></table>
</div>
2.渲染表格
table.render({
elem: '#js_table_reource_invite_supplier_index_table',
data:[],
cellMinWidth: 80,
maxHeight:300,
loading: true,
even: true,
method: 'POST',
cols: [
[
{type: 'numbers', title: '序号'},
{type: 'checkbox', width: 50},
{field: 'provider_name', title: '供方名称',width: 150},
{field: 'is_qualified', title: '是否合格',width: 100, align: 'center',templet:function(row){
var html = "<input type='checkbox' lay-skin='primary' lay-filter='checkboxIsSelected' table-index='"+row.LAY_TABLE_INDEX+"' class='checkboxIsSelected' value='1' ";
if(row.is_qualified == 1){
html += " checked ";
}
html += ">";
return html;
}},
{
field:'remark', title: '综合评语', align: 'center',edit: 'text'
}
]],
done: function (obj) {
layer.closeAll();
form.on('checkbox(checkboxIsSelected)', function(data){
var _index = $(data.elem).attr('table-index')||0;
if(data.elem.checked){
obj.data[_index].is_qualified = data.value;
}else{
obj.data[_index].is_qualified = 2;
}
});
}
});
第二步,获取表格中的数据
var supplierList = table.cache.js_table_reource_invite_supplier_index_table;
layui table中使用checkbox的更多相关文章
- layui table中固定表头,弹框缩放之后,表头对不齐问题
新手一枚 直接上解决方案 在layui弹出成功后再渲染表格数据 具体操作就是在layer弹层完成之后的回调中渲染表格数据 layer.open({ type: 1, content: $(&quo ...
- JQuery 遍历table中的checkbox 并对行数据进行校验
JQuery中confirm的使用 $(document).ready(function () { $("#Btn_Print").click(function () { var ...
- Jquery 控制table中的checkbox 相关选中事件
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- layui table 中固定列的行高和table行高不一致
解决方法:只需在done回调函数执行以下方法 done: function(res, curr, count){ $(".layui-table-main tr").each(fu ...
- layui.table前端+后台处理+分页
前端 注:监听工具条没有详细写,但路子一样的 @section head{ <script src="~/Content/jquery-easyui-1.5.5.4/jquery.ea ...
- layui.table图片显示不全和404问题
1.图片显示不全 在使用layui.table组件中,加载的图片显示不全,需重新定义CSS如下: .layui-table-cell{ height: auto!important; white-sp ...
- layui table指定某一行样式
1.想指定layui table中某一行的样式,找了这个资源可行.转自: https://blog.csdn.net/weixin_44729896/article/details/100524824 ...
- layui框架中关于table方法级渲染和自动化渲染之间的区别简单介绍
方法级渲染: <table class="layui-hide" id="LAY_table_user" lay-filter="user&qu ...
- LayUI table表格控件 如何显示 对象中的属性(针对Mybatis的级联查询--一对一情况)
1.entity如下: 2.Mybatis的Mapper.xml文件如下 <resultMap id="BaseResultMapPlus" type="dicIt ...
随机推荐
- Windows命令行(DOS命令)教程
一.命令行简介 命令行就是在Windows操作系统中打开DOS窗口,以字符串的形式执行Windows管理程序. 在这里,先解释什么是DOS? DOS——Disk Operation System 磁盘 ...
- 第一篇 css导入方式 及选择器
一 推荐资料 推荐书籍 css Zen Garden 中文(css禅意花园) 二.css样式 1.css样式表特征 继承性 大多数css的样式规则可以被继承 层叠性 1)可以定义 多个样式 2)不冲 ...
- codeforces 466C 计数 codeforces 483B 二分 容斥
题意:给你n个数,将他们分成连续的三个部分使得每个部分的和相同,求出分法的种数. 思路:用一个数组a[i]记下从第一个点到当前i点的总和.最后一个点是总和为sum的点,只需求出总和为1/3sum的点和 ...
- Spring- 异常org.xml.sax.SAXParseException; systemId: http://www.springframework.org/schema/context/; lineNumber: 1; columnNumber: 55; 在 publicId 和 systemId 之间需要有空格。
抛出异常 六月 03, 2018 7:40:44 下午 org.springframework.context.support.AbstractApplicationContext prepareRe ...
- jQuery绿色下拉网站导航
jQuery,下拉菜单,网站导航,绿色导航,菜单导航,jQuery绿色下拉网站导航是一款基于jquery实现的鼠标滑过下拉显示二级菜单. jquery特效代码:http://www.huiyi8.co ...
- Spring MVC的工作原理和机制
Spring MVC的工作原理和机制 参考: springMVC 的工作原理和机制 - 孤鸿子 - 博客园https://www.cnblogs.com/zbf1214/p/5265117.html ...
- 计算机丨浏览器访问出现DNS_PROBE_POSSIBLE解决方法
方法1.打开命令控制台输入: netsh winsock reset.提示重启,电脑重启后就ok了. 其他方法待续......
- 【ACM-ICPC 2018 徐州赛区网络预赛】D.Easy Math 杜教筛
代码 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 20000000; ...
- codeforces 622B B. The Time
B. The Time time limit per test 1 second memory limit per test 256 megabytes input standard input ou ...
- linux命令学习笔记(41):ps命令
Linux中的ps命令是Process Status的缩写.ps命令用来列出系统中当前运行的那些进程.ps命令列出的是当前 那些进程的快照,就是执行ps命令的那个时刻的那些进程,如果想要动态的显示进程 ...