layui数据表开启radio,并且点击radio⾏触发事件
layui.use(['index','admin','table','laydate'],function(){
var $ = layui.$,form = layui.form,admin = layui.admin,table = layui.table,laydate = layui.laydate;
elem:'#laydate-format'
,range:'~'
});
//监听⾏单击事件(单击事件为:rowDouble)
<('row(data_list)',function(obj){
var data = obj.data;
$('#address').val(data.address);
$('#address_id').val(data.id);
der_id)
{
$('#terrace_order_id').der_id);
}
});
//数据列表管理
elem:'#data_list'
,url:'{:url(request()->action())}'//模拟接⼝
,where:{"get":'list',"type":"{$type}"}
,cols:[[
htmlradio添加切换事件{type:'radio', fixed:'left'}
,{field:'order_number', width:220, title:'订单编号', align:'center'}
,{field:'order_amount', width:90, title:'订单⾦额', align:'center'}
,{field:'pay_time', width:160, title:'⽀付时间', align:'center'}
,{field:'id', width:90, title:'ID', align:'center'}
,{field:'contact',width:100,title:'联系⼈', align:'center'}
,{field:'mobile', width:120,title:'⼿机号', align:'center'}
,
{field:'address', width:300,title:'详细地址', align:'center'}
]]
,page:{
layout:['prev','page','next','skip','count']//⾃定义分页布局,'limit'
,groups:9//只显⽰ 5 个连续页码
,limit:30
//,limits: [30,100,300,500,1000]
,first:false//不显⽰⾸页
,last:false//不显⽰尾页
},done:function(res, curr, count){
var type='{$type}';
if(type!=3)
{
// 隐藏列
$(".layui-table-box").find("[data-field='order_number']").css("display","none");
$(".layui-table-box").find("[data-field='order_amount']").css("display","none");
$(".layui-table-box").find("[data-field='pay_time']").css("display","none");
}
}
});
})

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。