先加一个table
<table class="layui-hide" id="tbUser" lay-filter="demo"></table>
<script>
layui.use('table', function () {
var table = layui.table;
table.render({
elem: '#tbUser'
, method: "get"
, height: 322
, id: 'listReload'
,url:"@Url.Action("方法", "控制器")",
, where: {
liushuihao: '1',
projectname: '1',
faqiren: '1',
zuzhi: '1'
}
, parseData: function (data) {
return {
"code": 0
, "msg": ""
, "count": 10
, data: data
}
}
, cellMinWidth: 80
, cols: [[ //标题栏
{ checkbox: true, LAY_CHECKED: false, align: 'center', width: 87 } //默认全选
, { field: 'ProcInstID', title: '流水号', align: 'center', width: 127 }
, { field: 'Entryname', title: '项目名称', align: 'center', width: 187 }
, { field: 'AgentName', title: '发起人', align: 'center', width: 100 }
, { field: 'AllOrgPath', title: '组织', align: 'center', width: 247 }
]]
, skin: 'row' //表格风格
, even: true
//, page: true //是否显示分页
// , limits: [6, 12, 18]
, limit: 1000 //每页默认显示的数量
//1
});
点击按钮更新table表格访问后台数据
$("#landselects").on("click", function () {
// alert(0);
table.reload('listReload', {
url:"@Url.Action("方法", "控制器")",
where: {
liushuihao: $("#liushuihao").val(),
projectname: $("#projectname").val(),
faqiren: $("#faqiren").val(),
zuzhi: $("#zuzhi").val()
}
})
});
});
</script>