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 ...
随机推荐
- window.location.assign和window.location.href区别
window.location.assign和window.location.href区别 window.location.assign(url)和window.location.href=url实现 ...
- 每天一个Linux命令(27)gzip命令
zip命令用来压缩文件.gzip是个使用广泛的压缩程序,文件经它压缩过后,其名称后面会多处“.gz”扩展名. (1)用法: 用法: gzip [选项参数][-s <压缩字尾字符 ...
- my.cnf重要配置参数说明
不同存储引擎中关键参数优化 MyISAM存储引擎 MyISAM存储引擎适用于读多写少,对读性能要求比较高的系统 官方文档:http://dev.mysql.com/doc/refman/5.6/en/ ...
- vo类总结
1.Camera类 camera类里面,首先camera有5个变量,fx_,fy_,cx_,cy_,depth_scale_5个变量,由外部传fx,fy,cx,cy,depth_scale给它.定义了 ...
- crond
Crond介绍 Crond是linux系统用来定期执行命令或程序的工具. 服务 /etc/init.d/crond 命令 crontab [root@rhel6 script]# crontab -h ...
- 1.SVN
1.SVN安装 SVN服务器端VisualSVN Server(64位OS必须装64位VisualSVN-Server,默认端口是443). 就像建立数据库一样,需要先在svn服务器VisualSVN ...
- apache 简单笔记
1.端口监听 可以多个 Listen 80Listen 8080 2.多网站 Listen 80Listen 8080 # Virtual hostsInclude conf/extra/httpd- ...
- CH6802 車的放置 和 CH6B24 Place the Robots
6802 車的放置 0x60「图论」例题 描述 给定一个N行M列的棋盘,已知某些格子禁止放置.问棋盘上最多能放多少个不能互相攻击的車.車放在格子里,攻击范围与中国象棋的"車"一致. ...
- BZOJ4003:[JLOI2015]城池攻占
浅谈左偏树:https://www.cnblogs.com/AKMer/p/10246635.html 题目传送门:https://lydsy.com/JudgeOnline/problem.php? ...
- 使用Rancher搭建K8S测试环境
使用Rancher搭建K8S测试环境 http://blog.csdn.net/csdn_duomaomao/article/details/75316926 环境准备(4台主机,Ubuntu16.0 ...