bootstrapTable格式化博客列表

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('【请填写功能名称】列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/blog";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "【请填写功能名称】",
                showSearch: false,
                showRefresh: false,
                showColumns: false,
                showToggle: false,
                columns: [
                {
                    field: 'id',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'title',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<h2>'+value+'</h2><br>');
                        actions.push('<p>'+row.createDate+'</p> ');
                        return actions.join('');
                     }
                },
                {
                    field: 'amount',
                    title: '阅读数量',
                    visible: false
                },
                {
                    field: 'createDate',
                    title: '创建时间',
                    visible: false
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>

 

posted @ 2022-02-22 21:57  银Q小霸王  阅读(127)  评论(0)    收藏  举报