• 关于Layui Table分页功能


    html代码 

    <table class="layui-hide layui-table " id="demo" lay-filter="reviewlist"></table>

    JS代码

    var table = layui.table;//表格
    //执行一个 table 实例
    table.render({
    elem: '#demo'
    , height: 460
    , url: '/AuditRecord/ReportList' //数据接口
    , cols: [[ //表头
    { field: 'AuditId', '10%', title: '编号' },
    { field: 'ReportCode', '20%', align: 'center', title: '报告编号', style: 'color: #339999;cursor: pointer', event: 'formLink' },
    { field: 'ReportName', '20%', align: 'center', title: '报告名称' },
    { field: 'ReviewName', '10%', align: 'center', title: '审核人' },
    { field: 'ReviewTime', '10%', align: 'center', title: '审核时间' },
    { field: 'ReviewResult', '10%', align: 'center', title: '审核结果' },
    { field: 'ReviewAdvice', '20%', align: 'center', title: '审核建议' },
    ]]
    , skin: 'row'
    , even: true
    , page: true //开启分页
    , limits: [3, 5, 10]
    , limit: 5 //每页默认显示的数量
    , done: function (res) {
    data = res.data;
    }
    });

    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    刚开始我以为我只需要将数据传给layui table,它可以自己进行分页功能,但是我发现数据根本没有进行分页,但是每次点击上一页,下一页,NetWork里面都有发起请求的记录,

    而且每次都传了页数和条数。

    最后我发现,layui table 分页是需要自己再后台写分页查询的!!!!

    这么简单的一个东西,迷惑了我两天

  • 相关阅读:
    如何编译完全使用静态库的可执行文件
    交叉编译jpeglib遇到的问题
    安装SDL遇到的问题
    软链接/硬链接删除事项
    alias命令使用
    Linux下学习摄像头使用
    018 字符串类型及操作
    017 示例3-天天向上的力量
    016 数字类型及操作
    015 基本数据类型
  • 原文地址:https://www.cnblogs.com/yourSixUncle/p/10609805.html
Copyright © 2020-2023  润新知