Bootstrap表格插件Bootstrap Table配置教程

bootstrap table idField和selectItemName

Bootstrap Table idField和selectItemName设置选择选中。这个和直接调用bootstrap table选中行接口有什么区别呢?其实这两个属性就是配合jquery的from serialize用,jquery的serialize()方法可以把from表单系列化成一个对象,如果不清楚serialize()方法作用可以先搜索一下相关文章,var data = $(form).serialize()。

名称 js属性 html属性 说明
idField idField data-id-field 设置选择行的字段
selectItemName selectItemName data-select-item-name 选中选中的值名称

html设置方法

<table id="table" data-select-item-name="id" data-id-field="idName"></table>

js设置方法

$('#table').bootstrapTable({
    idField, "id",//设置列为选中列
    selectItemName, "idName",//设置列为选中列
    columns: columns,
    data: data
});

在线试一试      

Catalog
快速入门 bootstrap table方法 bootstrap table事件 bootstrap table下载 基础配置 row Attributes设置行属性 custom Sort自定义排序 table Cache缓存数据 content Type设置 response Handler total/Data Field JSON格式 escape显示html标签 idField和selectItemName cardView卡片视图模式 detailView详情视图模式 icons图标相关设置 本地化中文设置 列相关设置 columns基础设置 sortable列排序 column选择操作列 column列属性列表 分页设置 bootstrap table服务端分页 table Method 方式设置 data Type数据格式 custom AJAX 自定义ajax bootstrap table前端分页 bootstrap table查询搜索 smartDisplay作用 分页时保持选择状态 工具栏相关 showHeader显示头部 showFooter显示底部 showColumns开启列刷选 showPaginationSwitch分页 showRefresh刷选按钮 showFullscreen toolbar工具栏设置 样式设置 固定表头并美化表头 设置表格样式隔行变色 rowStyle设置行样式 theadClasses设置表头样式 footerStyle底部样式