Bootstrap table 表格数据加载(load)及追加(append)

By | 2020年5月28日

表格数据加载:

$("#table-list-webhoo").bootstrapTable('load', [{
                      xh:function (value, row, index) {
                          return index+1;
                      },
                      goods_name:dataGoods.goodsName,
                      code:dataGoods.goodsCode,
                      goods_spec:dataGoods.goodsSpec,
                      unit:"件",
                      sale_price:dataGoods.salePrice,
                      sale_money:dataGoods.salePrice,
                      goods_count:1,
                      goods_money:dataGoods.salePrice,
                      opt:function () {
                          return '\
                              <div class="btn-group btn-group-sm">\
                                <button type="button" class="btn btn-danger">删除</button>\
                              </div>';
                      }
                    }]);
表格数据追加:
$("#table-list-webhoo").bootstrapTable('append', [{
                      xh:function (value, row, index) {
                          return index+1;
                      },
                      goods_name:dataGoods.goodsName,
                      code:dataGoods.goodsCode,
                      goods_spec:dataGoods.goodsSpec,
                      unit:"件",
                      sale_price:dataGoods.salePrice,
                      sale_money:dataGoods.salePrice,
                      goods_count:1,
                      goods_money:dataGoods.salePrice,
                      opt:function () {
                          return '\
                              <div class="btn-group btn-group-sm">\
                                <button type="button" class="btn btn-danger">删除</button>\
                              </div>';
                      }
                    }]);

发表评论

电子邮件地址不会被公开。 必填项已用*标注