dapper分页HTML

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <link href="Content/bootstrap.css" rel="stylesheet" />
    <script src="Scripts/jquery-3.3.1.min.js"></script>
    <link href="Content/pagination.css" rel="stylesheet" />
    <script src="Scripts/pagination.js"></script>
    <script>
        $(function () {
            //初次加载显示分页
            $.ajax({
                url: "http://localhost:49586/api/Page",
                data: {PageIndex:1},
                type: "get",
                dataType: "json",
                success: function (result) {
                    Pager(result.totalCount);
                }
            })
        })
        function Pager(index_Pager) {
            $("#pagination").pagination(index_Pager, {
                //省略号后面显示的个数
                num_edge_entries: 1,
                //省略号前面显示的个数
                num_display_entries: 1,
                prev_text: "上一页",
                next_text: "下一页",
                callback: CallPagerData,
                //每页显示的条数
                items_per_page: 2
            });
        }
        function CallPagerData(page_index, jq) {
            $.ajax({
                url: "http://localhost:49586/api/Page",
                data: { PageIndex: page_index+1 },
                type: "get",
                dataType: "json",
                success: function (result) {
                    ShowList(result.data);
                }

            })
        }
        function ShowList(result) {
            $("#list").empty();
            var str = "";
            $(result).each(function (i, n) {
                str += "<tr>" +
                    "<td>"+n.Id+"</td>" +
                    "<td>"+n.Dtitle+"</td>" +
                    "<td>"+n.Dname+"</td>" +
                    "<td>"+n.SubTime+"</td>" +
                    "<td>" + n.Dinfo + "</td>" +
                    "<td><input id='Button1' type='button' value='修改' οnclick='edit()'/></td>" +
                    "</tr>";
            })
            $("#list").append(str);
        }
        function Export() {
            window.location.href = 'http://localhost:49586/api/Export';
        }
        function edit() {
            location.href = '/Edit.html?id=' + "王少帅";
        }
    </script>
</head>
<body>
    <div style="width:800px;margin:auto">
        <input id="Button1" type="button" value="导出" class="btn btn-primary" οnclick="Export()" />
        
        <table class="table table-bordered">
            <tr>
                <td>序号</td>
                <td>日志标题</td>
                <td>日志类型</td>
                <td>发布时间</td>
                <td>日志内容</td>
                <td>操作</td>
            </tr>
            <tbody id="list"></tbody>
        </table>
    </div>
    <div style="width:500px;margin-left:615px" class="pagination" id="pagination">

    </div>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值