1.下拉框需要添加css不然显示不出来
.layui-table-cell {
overflow: visible;
}
.layui-table-box {
overflow: visible;
}
.layui-table-body {
overflow: visible;
}
.layui-form-select dl dd{
text-align: left;
}
2.表格内嵌select
{field: "authlevel", title: "层级",width:135,align: 'center' ,templet:function (data) {
return `
<select name='authlevel' lay-filter='authlevel' id='authlevel' data-value='${data.level}'>
<option value='0'>1层级</option>
<option value='1'>2层级</option>
<option value='2'>3层级</option>
<option value='3'>4层级</option>
</select>`
}},
3.表格select回显
done:function(res,curr,count){
count || this.elem.next('.layui-table-view').find('.layui-table-header').css('overflow', 'auto');
layui.each($('select'), function (index, item) {
var elem = $(item);
elem.val(elem.data('value')).parents('div.layui-table-cell').css('overflow', 'visible');
});
form.render();
}