Layui搜索及重载table

//搜索时重载
var active = {
        reload: function () {
            var demoReload = $('#search');
            party.reload({
                 where: {
                    search: demoReload.val()
                }
                //, done: function (res, curr, count) {
                //    this.where = {};
                //将搜索的值清空,避免table重载时,是根据上一次的搜索值搜索的结果
                //}
            });
        }
    };

    $('#searchBtn').on('click', function () {
        var type = $(this).data('type');
        active[type] ? active[type].call(this) : '';//搜索时重载table
    });

 

posted @ 2019-12-20 16:36  Zdelta  阅读(19)  评论(0编辑  收藏  举报