关于layui 前台页面表单显示内容

function loadTickets(jsonEntity) {
        var id = $("#byId").val();
        table.render({
            elem : '#test',
            url : url,   //这里写调用后台方法的路径
            height: 450, //设置表单的长度,也可以设置宽度 width;
            toolbar : '#toolbarDemo', // 开启工具栏,此处显示默认图标,可以自定义模板,详见文档
            page : true,    //page:为true 时, 开启分页功能,为false时,关闭分页功能;
            unresize : false,    //是否禁用拖拽列宽;默认为false
            where : jsonEntity, 
            totalRow : true,// 开启合计行
            limits : [ 5, 15, 30 ], //设置分页的下拉条数;
            limit : 5,  //设置每页显示几条
            async : false,
            cols : [ [ {
                type : 'checkbox', //加上复选框
                fixed : 'left' //放在左边
            }, {
                field : 'name',title : '名称',    event : 'monthSign',    width : '20%',    align : 'center',    edit : 'text',
                templet : function(row) {
                    return row.name;
                }
            }, {
                field : 'code',title : '编码',    event : 'monthSign',    width : '7%',    align : 'center',    edit : 'text',
                templet : function(row) {
                    return row.code;
                }
            }, {
                field : 'path',title : '路径',    event : 'monthSign',    '10%',    align : 'center',    edit : 'text',
                templet : function(row) {
                    return row.path;
                }
            } ] ],
            done : function(res, curr, count) {
                currentPage = curr;
            }
        });

    }

基本上一行一注释了。。。

当然了,官方文档更加清晰应该:    https://www.layui.com/demo/table/toolbar.html



原文地址:https://www.cnblogs.com/a973692898/p/11690250.html