我使用bootstrap表来加载数据。 Bootstrap table
我有下一个表格html:
当我点击“更多结果”链接时,会发生表格的分页,怎么办呢?
这是html代码:
<table id="table" class="table">
<thead>
<tr>
<th data-field="field1">Title1</th>
<th data-field="field2">Title2</th>
<th data-field="field3">Title3</th>
</tr>
</thead>
<tbody></tbody>
<tfoot>
<tr>
<td colspan="6"><a href="#">...More results...</a></td>
</tr>
</tfoot>
</table>
这是js代码:
// Loading json in talbe
$("#table").bootstrapTable({
formatNoMatches: function () {
return 'No records';
},
//Assigning data to table docs
data: data,
pagination: true,
pageSize: 10
});
这是css代码:
.fixed-table-loading, .fixed-table-pagination {
display: none !important;
}
这是json:
var data = [
{
"field1": "Dato1",
"field2": "Dato2",
"field3": "Dato3"
},
{
"field1": "Dato1",
"field2": "Dato2",
"field3": "Dato3"
},
{
"field1": "Dato1",
"field2": "Dato2",
"field3": "Dato3"
}
];
如果我们有超过10个结果,则只显示“更多结果”按钮。
谢谢,