layui table组件

layui table组件

table.render({
    elem: '#prevention_list'
    ,url: '/prevention/getPreventionBigDataList'
    ,page: {
        theme: '#5a98de'
        ,layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
    }
    ,request: {
        pageNuma : 'page'
        ,limitName : 'pageSize'
    }
    ,cols: [[
        {field:'dataId',width:'5%', title:'编号', sort: true,align: 'center'}
        ,{field:'caseTypeName',width:'10%', title:'涉案类型',align: 'center'}
        ,{field:'gender',width:'5%', title:'性别',align: 'center',templet:function (d) {
                return d.gender==1?'男':'女';
            }}
        ,{field:'caseTime',width:'15%', title:'时间', align: 'center',templet:function (d) {
                return formatDateToYearMonth(d.caseTime);
            }}
        ,{field:'occupationalTypeName',width:'10%', title:'职业特征',align: 'center'}
        ,{field:'subjectIdentityName',width:'10%', title:'主体身份', align: 'center'}
        ,{field:'educationTypeName',width:'15%', title:'文化程度', align: 'center'}
        ,{field:'criminalMotiveName',width:'10%', title:'犯罪动机',align: 'center'}
        ,{field:'caseMakingToolName',width:'10%', title:'作案工具', align: 'center'}
        ,{field:'',width:'10%', title:'操作', align: 'center',templet:function (d) {
                return '      \n';
            }}
    ]]
    ,response: {
        statusName: 'code'
        ,statusCode: 200
        ,msgName: ''
        ,countName: 'total'
        ,dataName: 'result'
    }
    ,text: {
        none: '暂无数据'
    }
});

后台代码返回格式:

JSONObject obj = new JSONObject();
obj.put("code",200);
obj.put("result",list1);
obj.put("total",count);
return obj;

你可能感兴趣的:(LayUI)