bootstrap-table加载数据序号自增实现
2020-05-28 12:32
351 查看
初始化表格时,序号自增实现方法:
$("#table-list-webhoo").bootstrapTable({ ......... //省略了相应的参数配置 columns : [ { //序号自增实现方法 title : '序号', field : 'xh', formatter: function (value, row, index) { return index+1; } },{ title : '商品名称', field : 'goods_name', }, { title : '编码', field : 'code', }, .......... ,{ title : '操作', field : 'opt', formatter: function () { return '\ <div class="btn-group btn-group-sm">\ <button type="button" class="btn btn-danger">删除</button>\ </div>'; } }] });
表格数据动态加载和追加的序号自增实现方法(append是追加数据,load是加载数据):
$("#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>'; } }]);
转载于:https://www.dsboke.com/2020/05/28/bootstrap-table_jia_zai_shu_ju_xu_hao_zi_zeng_shi_xian/
相关文章推荐
- Bootstrap-Table实现从服务器加载数据进行显示
- Bootstrap-Table实现从服务器加载数据进行显示
- Bootstrap-Table实现从服务器加载数据进行显示
- Bootstrap-Table实现从服务器加载数据进行显示
- 使用Bootstrap Tabs选项卡Ajax加载数据的实现以及遇到的问题;
- knockoutjs+jquery.gridgroup 实现table数据加载和行合并
- bootstrap-table插件数据加载方式
- vue elementUI table表格数据 滚动懒加载的实现方法
- 使用nodejs,express,mysql,Bootstrap开发采购招标网站(四)Bootstrap-table实现Ajax新增修改数据
- BootStrap Fileinput插件和Bootstrap table表格插件相结合实现文件上传、预览、提交的导入Excel数据操作步骤
- Bootstrap Table表格一直加载(load)不了数据的快速解决方法
- Bootstrap Data Table简单使用(动态加载数据)
- 动态的把数据显示在table中,点击某一行的删除按钮实现该行的删除(通过ajax实现页面的无刷新加载)
- 结合bootstrap fileinput插件和Bootstrap-table表格插件,实现文件上传、预览、提交的导入Excel数据操作流程
- iphone利用线程实现数据的加载,并展示在table列表中
- BootStrap中的table实现数据填充与分页应用小结
- 用tableView实现的一种加载数据的布局
- bootstrap 实现用 table 表格显示list数据
- 使用Bootstrap Tabs选项卡Ajax加载数据实现
- BootStrap Table实现server分页序号连续显示功能(当前页从上一页的结束序号开始)