代码如下
<table class="layui-hide " id="LAY_tb_user" lay-filter="tb_user_sign"></table>
<script>
layui.use('table', function() {
console.log("user_check_in")
var $ = layui.$,table = layui.table,form = layui.form,layer = layui.layer,edit_layer;
//初始化表格参数
var table_params_sign = {
elem : '#LAY_tb_user_check_in',
url : './getChenckInPageForListByUserId.do',
method : 'post',
id : 'UserSigninReload',
limit:10,
limits:[10,25,50,100,150,200],
page : true,
where:{userId:'${user.id}'},
response : {
countName : 'count',
dataName : 'data'
},
cols : [ [ /* {
checkbox : true,
align : 'center'
}, */
{
field: 'id',
title: '编号',
align: 'center',
width: '7%',
valign: 'middle'
},
{
field: 'headImgUrl',
title: '用户头像',
align: 'center',
width: '10%',
valign: 'middle',
},
{
field: 'nikeName',
title: '用户昵称',
align: 'center',
width: '15%',
valign: 'middle'
},
{
field: 'signIn',
title: '是否签到',
align: 'center',
width: '10%',
valign: 'middle',
/* templet: function (d) {
if (d.signIn ==1) {
return "已签到";
} else {
return "未签到";
}
}*/
},
{
field: 'signTime',
title: '签到时间',
align: 'center',
width: '10%',
valign: 'middle'
},
{
field: 'score',
title: '签到积分',
align: 'center',
width: '17%',
valign: 'middle',
} ,
{
title : '操作',
align : 'center' ,
width: '15%',
toolbar: '#barEdit_check_in'
} ] ]
};
//渲染表格
table.render(table_params_sign);
});
</script>
问题是因为 id对应不上一个是
js代码id是LAY_tb_user_check_in table标签id是LAY_tb_user 改为一样就好了