layui的table重载问题

话不多说,先上代码:

这时绑定数据

table.render({
elem: '#table-data',
//, id: 'roleId' //要隐藏的列名
url: 'GetList', // 请求的数据地址
id: 'testReload',

toolbar: '#table-data-toolbar',
title: "软件管理",
page: true,
limit: 10,
cols: [
[
{ type: "checkbox", width: 50, fixed: "left" },
{ field: 'aid', title: '编号', width: 80, fixed: 'left', sort: true },
{ field: 'appId', title: '软件加密', width: 80 },
{ field: 'softwareName', title: '软件名', width: 200 },
{ field: 'version', title: '版本', width: 130 },
{ field: 'registered', title: '注册数量', width: 100 },
{ field: 'try', title: '试用数量', width: 120 },
{
field: 'isEnable',
title: '是否启用',
width: 110,
templet: '#chbox-isEnable',
unresize: true
},
{ filed: 'createTime', title: '创建时间', width: 120 },
{ fixed: 'right', title: '操作', toolbar: '#table-data-tool', width: 150 }
]
]

});

这时重载数据:

$('#searchList').on('click', function () {
var name = $('#softName');
var softId = $('#softId');
var userName = $('#userName');
console.log(name.val());
table.reload('testReload', {
url:'GetList',
page: {curr:1},
where: {
softName: name.val(),
userName: userName.val(),
softId: softId.val()
}

},'data')
})

where:{里面的值是传到后台的值,有点像键值对形式}

扫描二维码关注公众号,回复: 9582996 查看本文章

后台代码:

 传进来做相应的判断就好了,怎么显示出去

猜你喜欢

转载自www.cnblogs.com/xiaoniandada101/p/12416105.html
今日推荐