不错呦!smile@林凯西,确保“准备文件”中的几个文件都有安装,S...您好,看了您这篇帖子觉得很有帮助。但是有个问题想请...我的修改过了怎么还被恶意注册呢 @jjjjiiii 用PJ快9年了,主要是A...PJ3啊,貌似很少有人用PJ了,现在不是WP就是z...@332347365,我当时接入时错误码没有-10...楼主,ChkValue值应为-103是什么意思呢?...大哥 你最近能看到我发的信息,请跟我联系,我有个制...
Bootstrap Table服务器端分页使用示例
编辑:dnawo 日期:2019-11-22
Bootstrap Table服务器端分页主要通过设置data-pagination和data-side-pagination两个属性来实现:
data_json.asp返回格式:
1、怎么修改远程数据请求方法?
当method="get"(默认)时:data_json.asp?order=asc&offset=0&limit=10
当method="post"时:{"order":"asc","offset":0,"limit":10}
2、怎么添加服务器端查询参数?
查询参数:data_json.asp?order=asc&offset=0&limit=10&domain=mzwu.com&keyword=abc
3、怎么修改分页参数类型?
当type=“limit”(默认)时:data_json.asp?order=asc&offset=0&limit=10
当type=“”时:data_json.asp?sortOrder=asc&pageSize=10&pageNumber=1
相关链接
[1].Bootstrap Table官网:https://bootstrap-table.com/
[2].Bootstrap Table Examples:https://live.bootstrap-table.com/
复制内容到剪贴板
程序代码

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Bootstrap Table服务器端分页使用示例</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--引入Bootstrap Table及关联样式-->
<link rel="stylesheet" href="//stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.6.3/css/all.css">
<link rel="stylesheet" href="//unpkg.com/bootstrap-table@1.15.3/dist/bootstrap-table.min.css">
</head>
<body>
<!--内容-->
<table data-toggle="table" data-url="data_json.asp" data-pagination="true" data-side-pagination="server">
<thead>
<tr>
<th data-field="id">Item ID</th>
<th data-field="name">Item Name</th>
<th data-field="price">Item Price</th>
</tr>
</thead>
</table>
<!--引入Bootstrap Table及关联脚本-->
<script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"></script>
<script src="//stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"></script>
<script src="//unpkg.com/bootstrap-table@1.15.3/dist/bootstrap-table.min.js"></script>
<script src="//unpkg.com/bootstrap-table@1.15.3/dist/locale/bootstrap-table-zh-CN.min.js"></script>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>Bootstrap Table服务器端分页使用示例</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--引入Bootstrap Table及关联样式-->
<link rel="stylesheet" href="//stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<link rel="stylesheet" href="//use.fontawesome.com/releases/v5.6.3/css/all.css">
<link rel="stylesheet" href="//unpkg.com/bootstrap-table@1.15.3/dist/bootstrap-table.min.css">
</head>
<body>
<!--内容-->
<table data-toggle="table" data-url="data_json.asp" data-pagination="true" data-side-pagination="server">
<thead>
<tr>
<th data-field="id">Item ID</th>
<th data-field="name">Item Name</th>
<th data-field="price">Item Price</th>
</tr>
</thead>
</table>
<!--引入Bootstrap Table及关联脚本-->
<script src="//code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"></script>
<script src="//stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"></script>
<script src="//unpkg.com/bootstrap-table@1.15.3/dist/bootstrap-table.min.js"></script>
<script src="//unpkg.com/bootstrap-table@1.15.3/dist/locale/bootstrap-table-zh-CN.min.js"></script>
</body>
</html>
data_json.asp返回格式:
复制内容到剪贴板
程序代码

{"total": 50,"rows":[{"id": "1","name": "Item 1","price": "$1"},{"id": "2","name": "Item 2","price": "$2"},{"id": "3","name": "Item 3","price": "$3"},{"id": "4","name": "Item 4","price": "$4"},{"id": "5","name": "Item 5","price": "$5"},{"id": "6","name": "Item 6","price": "$6"},{"id": "7","name": "Item 7","price": "$7"},{"id": "8","name": "Item 8","price": "$8"},{"id": "9","name": "Item 9","price": "$9"},{"id": "10","name": "Item 10","price": "$10"}]}
1、怎么修改远程数据请求方法?
复制内容到剪贴板
程序代码

<table data-toggle="table" data-url="data_json.asp" data-pagination="true" data-side-pagination="server" data-method="post">
<thead>
<tr>
<th data-field="id">Item ID</th>
<th data-field="name">Item Name</th>
<th data-field="price">Item Price</th>
</tr>
</thead>
</table>
<thead>
<tr>
<th data-field="id">Item ID</th>
<th data-field="name">Item Name</th>
<th data-field="price">Item Price</th>
</tr>
</thead>
</table>
当method="get"(默认)时:data_json.asp?order=asc&offset=0&limit=10
当method="post"时:{"order":"asc","offset":0,"limit":10}
2、怎么添加服务器端查询参数?
复制内容到剪贴板
程序代码

<table data-toggle="table" data-url="data_json.asp" data-pagination="true" data-side-pagination="server" data-query-params="queryParams">
<thead>
<tr>
<th data-field="id">Item ID</th>
<th data-field="name">Item Name</th>
<th data-field="price">Item Price</th>
</tr>
</thead>
</table>
<script>
function queryParams(params) {
params.domain = "mzwu.com"
params.keyword = "abc"
return params
}
</script>
<thead>
<tr>
<th data-field="id">Item ID</th>
<th data-field="name">Item Name</th>
<th data-field="price">Item Price</th>
</tr>
</thead>
</table>
<script>
function queryParams(params) {
params.domain = "mzwu.com"
params.keyword = "abc"
return params
}
</script>
查询参数:data_json.asp?order=asc&offset=0&limit=10&domain=mzwu.com&keyword=abc
3、怎么修改分页参数类型?
复制内容到剪贴板
程序代码

<table data-toggle="table" data-url="data_json.asp" data-pagination="true" data-side-pagination="server" data-query-params-type="limit">
<thead>
<tr>
<th data-field="id">Item ID</th>
<th data-field="name">Item Name</th>
<th data-field="price">Item Price</th>
</tr>
</thead>
</table>
<thead>
<tr>
<th data-field="id">Item ID</th>
<th data-field="name">Item Name</th>
<th data-field="price">Item Price</th>
</tr>
</thead>
</table>
当type=“limit”(默认)时:data_json.asp?order=asc&offset=0&limit=10
当type=“”时:data_json.asp?sortOrder=asc&pageSize=10&pageNumber=1
相关链接
[1].Bootstrap Table官网:https://bootstrap-table.com/
[2].Bootstrap Table Examples:https://live.bootstrap-table.com/
评论: 0 | 引用: 0 | 查看次数: 2174
发表评论
请登录后再发表评论!