layui动态列试试
var str = [
{field:'id', title: 'id', width:90},
{field:'proNo', title: '项目编号', width:90},
{field:'content', title: '产品名称', width:120},
{field:'moldtype', title: '模具制号', width:120},
{field:'jgzt', title: '加工阶段',width:90},
];
str.push({field:'+ mydate +',id:'+x+',title: mydate, width:100});
layui.use('table', function(){
var table = layui.table;
table.render({
elem: '#demos'
,url:WEB_CONTEXT+'#'
,cols: [str] ,
done: function (res, curr, count) {
merge(res, curr, count);
setMessage(res, curr, count);
}
});
});
没想到还有这种用法,开心