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:{里面的值是传到后台的值,有点像键值对形式}

 

 

后台代码:

 

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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM