bootstrapTable 应用

版权声明:内容记录学习过成文章,仅供参考 https://blog.csdn.net/qq_40195958/article/details/81508745

bootstrapTable应用

1、只刷新列表
   $('#table').bootstrapTable('refresh');
2、通过传递json到后台刷新
   $('#table').bootstrapTable('refresh',json);
3、取选中的数据
    $("#table").bootstrapTable('getSelections');
4、获得所有数据
    $("#table")..bootstrapTable('getData');
5、加载数据,json数据格式 
    $("#table").bootstrapTable('load',json);
6、移除所有数据
    $("#table").bootstrapTable('remvoeAll');
7、根据主键移除数据
    var array = [];
    $('#table').bootstrapTable('remove', {
                field: "id",
                values: array
            }); 
8、插入数据
  (1)插入尾部
      $("#table").bootstrapTable('append', json);
  (2)尾部插入
      $("#table").bootstrapTable('prepend', json);     
9、更新行(行索引,数据)
    $('#table').bootstrapTable('updateRow', {
        index: index, 
        row: json});    
10、更新指定列
    var rows = {
            index : index,  //更新列所在行的索引
            field : "status", //要更新列的field
            value : "正常" //要更新列的数据
        }//更新表格数据        
    $('#table').bootstrapTable("updateCell",rows);    
11.插入数据
    $('#table').bootstrapTable('insertRow', {
            index: index//数据行树
            row: json
        }); 

猜你喜欢

转载自blog.csdn.net/qq_40195958/article/details/81508745