BootstrapTable 获取选择行数据

本文介绍如何使用BootstrapTable插件实现表格数据的选择功能,并提供了配置示例代码及获取已选中行数据的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

BootstrapTable 获取选择行数据


  • 开启选择
  • 增加选择列

$("#costTable").bootstrapTable({
            url: "/pemProductFoundCostpay/getPageList",
            method: "post",
            contentType: "application/x-www-form-urlencoded; charset=UTF-8",
            striped: true,
            pagination: true,
            paginationLoop: false,
            sortable: true,
            sortOrder: "desc",
            sidePagination: "server",
            showColumns: true,
            showRefresh: true,
            showFooter: false,
            clickToSelect: true,
            uniqueId: "ID",
            idField: "id",
            editable: false,
            checkboxHeader: true,
            singleSelect: true, //开启单选
            columns: [[
            //增加选择列
                {field: 'id', title: 'id', align: 'center', halign: 'center', width: '10%', visible: true, sortable: true},
            )};
  • 获取
$("#costTable").bootstrapTable('getSelections');

Bootstrap Table 表格异常强大,文档也很详细,遇到问题可去查询 -> [ Bootstrap Table 中文API ]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值