Layui下拉框之select模糊搜索查询功能

Layui常用总结

https://blog.csdn.net/libusi001/article/details/100065911

目录

一、HTML代码

二、列表项

三、reload重载

四、注意事项

一、HTML代码

二、列表项

layui.use('table', function () {var table = layui.table;table.render({elem: '#test', url: ctxPath + 'xx/select', toolbar: '#toolbarDemo', title: '学校数据表', cols: [[{title: 'ID', width: 60, fixed: 'left', unresize: true, type:'numbers'}, {field: '', title: '学校', width: 320, align: 'center'}, {fixed: 'right', title: '操作', toolbar: '#barDemo', width: 150, align: 'center'}]], page: true, id: 'reload'});

三、reload重载

var $ = layui.$, active = {reload: function () {var school= $('#schoolId');//执行重载table.reload('reload', {page: {curr: 1}, where: {schoolId: schoolId.val(),}}, 'data');}};$('#search').on('click', function () {var type = $(this).data('type');active[type] ? active[type].call(this) : '';});

四、注意事项

1、加lay-search,下拉框内可搜索

2、id: 'reload'为重载id,用于绑定重载事件

3、where部分最后一个参数后面不可加,

 

有用请点赞,养成良好习惯!

疑问、交流、鼓励请留言!

 



本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部