layui 表格重载

 省略引入过程

  //执行一个 table 实例
        var $table  = table.render({
            elem: '#demo'
            ,height: 420
            ,url: '/operation/getAllMetting/' //数据接口
            ,title: '用户表'
            ,page: true //开启分页
            ,toolbar: 'default' //开启工具栏,此处显示默认图标,可以自定义模板,详见文档
            ,totalRow: false //开启合计行
            ,defaultToolbar: ['filter', 'print']//隐藏导出按钮
            ,cols: [[ //表头
                {type: 'checkbox', fixed: 'left'}
                ,{field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
                ,{field: 'meetingNo', title: '序号', width:80}
                ,{field: 'createTime', title: '开会日期', width: 90}
                ,{field: 'meetingNumber', title: '会次', width:80}
                ,{field: 'notice', title: '通知', width: 80}
                ,{field: 'meetingName', title: '会议名称', width:150}
                ,{fixed: 'right', width: 165, align:'center', toolbar: '#barDemo'}
            ]]
            ,done: function () {
                $("[data-field='id']").css('display','none');
            }

        });
 //重载表格方法
        $('#search').on('click', function(){
            var meetingNo= $("#meetingNo").val();
            var createTime= $("#createTime").val();
          
            $table.reload({
                where:{
                    meetingNo:meetingNo, createTime:createTime,
                

                },
                page: {
                    curr: 1 //重新从第 1 页开始
                }

            })

        });

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章