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 ...
随机推荐
- 牛客小白月赛1 F 三视图 【循环】
题目链接 https://www.nowcoder.com/acm/contest/85/F 思路 记录每一个面 上的点 是否有方块 然后 根据它的输出顺序 遍历访问 如果有 输出 'X' 否则 输出 ...
- 牛客小白月赛1 D 多项式乘法 【循环】
题目链接 https://www.nowcoder.com/acm/contest/85/D 思路 因为数据范围较小 ,所以 可以直接 一个一个乘 AC代码 #include <cstdio&g ...
- [原创]java WEB学习笔记02:javaWeb开发的目录结构
本博客为原创:综合 尚硅谷(http://www.atguigu.com)的系统教程(深表感谢)和 网络上的现有资源(博客,文档,图书等),资源的出处我会标明 本博客的目的:①总结自己的学习过程,相当 ...
- linux系统的nobody用户
正如window系统在安装完毕后会自动建立一些用户账号,linux也会生成一些目标是为了完成特定任务的账号,如nobody和ftp 首先,nobody是一个普通用户,没有特权,他存在的目的是为了让任何 ...
- [算法]String to Integer(atoi)
Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. ...
- BestCoder Round #4 之 Miaomiao's Geometry(2014/8/10)
最后收到邮件说注意小数的问题!此代码并没有过所有数据,请读者参考算法, 自己再去修改一下吧!注意小数问题! Miaomiao's Geometry Time Limit: 2000/1000 MS ( ...
- codevs1217 借教室
借教室(classroom.cpp/c/pas)[问题描述]在大学期间,经常需要租借教室.大到院系举办活动,小到学习小组自习讨论,都需要向学校申请借教室.教室的大小功能不同,借教室人的身份不同,借教室 ...
- linux应用之yum命令的软件源的更换(centos)
[1] 首先备份/etc/yum.repos.d/CentOS-Base.repo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/Cent ...
- 有關WCF一個自認爲比較經典的博客
无废话WCF入门教程四[WCF的配置文件] (http://www.cnblogs.com/iamlilinfeng/archive/2012/10/02/2710224.html) -------- ...
- UVA-11020(BST)
题意: 给n个点,一个点(x,y)有优势时满足不存在点(fx,fy)使得fx<x,fy<=y或fx<=x,fy<y;问当前有多少个有优势点; 思路: 学习BST的入门题,代码是 ...