【问题标题】:Bootstrap-table reset table sort icon引导表重置表排序图标
【发布时间】:2015-11-09 05:44:12
【问题描述】:

我使用 bootstrap-table 从数据库中填充数据,但我遇到了如何重置表的问题,包括“排序”功能及其图标。到目前为止我用过:

$('#table').bootstrapTable('resetView');
$('#table').bootstrapTable('refresh');

http://bootstrap-table.wenzhixin.net.cn/documentation/ 上,但它们都不起作用。我有一个重置按钮,但它不起作用。

$('#resetBtn').on('click', function() {

});

【问题讨论】:

    标签: twitter-bootstrap bootstrap-table


    【解决方案1】:

    你可以销毁表并重新构建它,尝试使用:

    $('#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(); 
    });
    

    希望这会有所帮助。

    【讨论】:

    • $('#table').bootstrapTable('destroy');当想要通过按钮单击刷新表格时需要。谢谢扎卡里亚!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-19
    • 2019-07-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多