EasyUI篇のDataGrid

时间:2023-03-09 03:24:18
EasyUI篇のDataGrid

HTML:

<table id="dg"></table> 或者 <div id="dg"></div>

JS:

$('#dg').datagrid({
        url: '/AdminNewList/GetList',
        method: 'post',
        rownumbers: true,
        columns: [[
            { field: 'ck', checkbox: true },
            { field: 'title', title: '标题', width: 200, align: 'center' },
            { field: 'author', title: '作者', width: 100, align: 'center' },
            { field: 'subDateTime', title: '时间', width: 150, align: 'center' },
            { field: 'msg', title: '详细', width: 400, align: 'center' },
            { field: 'delete', title: '删除', width: 100, align: 'center' },
            { field: 'editor', title: '修改', width: 100, align: 'center' }
        ]]
    });

注:后台GetList方法,返回的是json字符串