EasyUI 表格填充

2022-04-19 / 0 评论 / 20 阅读 / 正在检测是否收录...
$(function () {
    var url = projectName + '/pns/notice/getNotices';
    var queryParams = {};
    initDataGrid(url, queryParams);
    $('#notice').datagrid({singleSelect: (this.value == 1)});

});


function initDataGrid(url, queryParams) {
    $('#notice').datagrid({
        method: 'post',
        url: url,
        queryParams: queryParams,
        nowrap: true,
        pagination: true,
        pageSize: 30,
        pageList: [10, 20, 30, 40, 50],
        fit: true,
        fitColumns: false,
        border: false,
        singleSelect: true,
        rownumbers: true,
        sortable: true,
        remoteSort: false,
        sortName: 'issueTime',
        sortOrder: 'desc',

        toolbar: [{
            text: "发布通知",
            iconCls: 'icon-add',
            handler: add
        }, {
            text: "批量删除",
            iconCls: 'icon-no',
            handler: Delete
        }],
        frozenColumns: [[{
            field: 'ck',
            checkbox: true,
            align: 'center',
        }, {
            field: 'ids',
            title: '序号',
            align: 'center',
            hidden: true,
        }, {
            title: '发布时间',
            field: 'issueTime',
            align: 'center',
            sortable: 'true',
            width: 220
        }, {
            title: '发布内容',
            field: 'content',
            align: 'left',
            width: 320,
            formatter: function (value, row, index) {
                return '<span title=' + value + '>' + value + '';
            }
        }, {
            title: '发布人',
            field: 'issueUser',
            align: 'left',
            width: 100
        }, {
            field: 'opt',
            title: '操作选项',
            align: 'center',
            width: 100,
            formatter: function (value, row, index) {
                var handleHtml = "";
                handleHtml += "<a href='javascript:void(0);' class='easyui-linkbutton' onclick='showNotice(" + row.id + ")'>查看详情</a>&nbsp;";
                return handleHtml;
            }
        }

        ]],

    });
}
本文共 29 个字数,平均阅读时长 ≈ 1分钟
0

打赏

海报

正在生成.....

评论 (0)

取消