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 ]