我使用bootstrap-table从数据库填充我的数据,但是我遇到了如何重置表格的问题,包括" sort"功能及其图标。到目前为止我用过:
$('#table').bootstrapTable('resetView');
$('#table').bootstrapTable('refresh');
在http://bootstrap-table.wenzhixin.net.cn/documentation/上,但没有一个有用。我有一个重置按钮,但它不起作用。
$('#resetBtn').on('click', function() {
});
答案 0 :(得分:4)
您可以销毁表并重建它,尝试使用:
$('#resetBtn').on('click', function() {
$('#table').bootstrapTable('destroy'); //Destroy bootstrap table
$('#table').bootstrapTable(); //Rebuild bootstrap table
//You can do it in one line
//$('#table').bootstrapTable('destroy').bootstrapTable();
});
希望这有帮助。