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 ...
随机推荐
- Effective java -- 6 方法
第三十八条:检查参数的有效性 第三十九条:必要时进行保护性拷贝 public class Period { private final Date start; private final Date e ...
- winform窗体取消最大化双击标题最大化
实现目标,固定窗体大小,1.窗体标题去掉最大化按钮2.双击窗体标题也不会最大化,彻底取消最大化 问题,如果设置窗体MaximizeBox和MinimumSize属性,看似问题解决了,单随之而来的问题是 ...
- echo 命令参数
echo 命令参数: -n 不换行输出 -e 解析转义字符(\n \t \b \r)
- QT下的QProcess调用外部程序
头文件widget.h #ifndef WIDGET_H #define WIDGET_H #include <QWidget> namespace Ui { class Widget; ...
- jupyter- 运维
jupyter运维常见CLI 查看安装的内核和位置 jupyter kernelspec list anaconda列出所有的环境 conda info -e
- matlab之viscircles()函数
函数功能:画圆 语法: viscircles(centers,radii) viscircles(ax,centers,radii) viscircles(___,Name,Value) h = vi ...
- JavaScript 使用技巧(持续更新)
JavaScript 使用技巧(持续更新) 类型检测 使用Object.prototype.toString.call(obj)的方式. 因为无论typeof还是instanceof都无法做到精确判断 ...
- DELPHI中四种EXCEL访问技术实现
一.引言 EXCEL在处理中文报表时功能非常强大,EXCEL报表访问也是信息系统开发中的一个重要内容,本文总结以往开发中所用到的几中EXCEL文件访问方法,在实际工作中也得到了很好的验证,本文列举了其 ...
- 数据库+maven
1.mysql <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-ja ...
- js 定义hash类
// JavaScript Documentfunction HashTable(){ this._hash={}; this._count=0; /** *添 ...