Bootstrap-table: 服务器端分页 + nextPage 方法
Bootstrap-table: Server Side pagination + nextPage method
我正在使用 Django 和应用 Bootstrap-table 来正确格式化我的 tables。
我有很多数据,所以我正在使用服务器端分页。效果很好。
现在我想实现一些方法,例如 nextPage
方法。
通过结合服务器端分页示例 jsfiddle + 方法 nextPage,它不起作用:单击按钮 nextPage
即使它绑定到 nextPage
方法也没有任何作用:
http://jsfiddle.net/ThePhi/msj2apLb/1/
<button id="button2" class="btn btn-default">nextPage</button>
<table data-toggle="table"
data-url="http://issues.wenzhixin.net.cn/examples/bootstrap_table/data"
data-pagination="true"
data-side-pagination="server"
data-page-list="[5, 10, 20, 50, 100, 200]"
data-search="true"
data-height="300">
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th data-field="id" data-align="right" data-sortable="true">Item ID</th>
<th data-field="name" data-align="center" data-sortable="true">Item Name</th>
<th data-field="price" data-sortable="true">Item Price</th>
</tr>
</thead>
</table>
<script>
var $table = $('#table'),
$button2 = $('#button2');
$(function () {
$button2.click(function () {
$table.bootstrapTable('nextPage');
});
});
</script>
我忘了放 id="table"
...
工作 jsFiddle:http://jsfiddle.net/ThePhi/msj2apLb/1/
我正在使用 Django 和应用 Bootstrap-table 来正确格式化我的 tables。
我有很多数据,所以我正在使用服务器端分页。效果很好。
现在我想实现一些方法,例如 nextPage
方法。
通过结合服务器端分页示例 jsfiddle + 方法 nextPage,它不起作用:单击按钮 nextPage
即使它绑定到 nextPage
方法也没有任何作用:
http://jsfiddle.net/ThePhi/msj2apLb/1/
<button id="button2" class="btn btn-default">nextPage</button>
<table data-toggle="table"
data-url="http://issues.wenzhixin.net.cn/examples/bootstrap_table/data"
data-pagination="true"
data-side-pagination="server"
data-page-list="[5, 10, 20, 50, 100, 200]"
data-search="true"
data-height="300">
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th data-field="id" data-align="right" data-sortable="true">Item ID</th>
<th data-field="name" data-align="center" data-sortable="true">Item Name</th>
<th data-field="price" data-sortable="true">Item Price</th>
</tr>
</thead>
</table>
<script>
var $table = $('#table'),
$button2 = $('#button2');
$(function () {
$button2.click(function () {
$table.bootstrapTable('nextPage');
});
});
</script>
我忘了放 id="table"
...
工作 jsFiddle:http://jsfiddle.net/ThePhi/msj2apLb/1/