1 Star 3 Fork 1

lizhun/bootstrap-table-example-study

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
grammar.html 86.81 KB
一键复制 编辑 原始数据 按行查看 历史
lizhun 提交于 2020-01-03 15:25 . readme优化
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Hello, Bootstrap Table!</title>
<link rel="stylesheet" type="text/css" href="./node_modules/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="./node_modules/bootstrap-table/dist/bootstrap-table.min.css">
<link rel="stylesheet" type="text/css" href="./node_modules/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="./css/style.css">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content">
<div class="wrapper wrapper-content animated fadeInRight">
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>表格参数</h5>
<p class="text-right">表格的参数定义在 jQuery.fn.bootstrapTable.defaults</p>
</div>
<div class="ibox-content">
<!-- table内容 -->
<table data-toggle="table" data-mobile-responsive="true">
<thead>
<tr>
<th>名称</th>
<th>属性</th>
<th>类型</th>
<th>默认</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>-</td>
<td>data-toggle</td>
<td>String</td>
<td>'table'</td>
<td>不用写 JavaScript 直接启用表格。</td>
</tr>
<tr>
<td>classes</td>
<td>data-classes</td>
<td>String</td>
<td>'table table-hover'</td>
<td>表格的类名称。默认情况下,表格是有边框的,你可以添加 'table-no-bordered' 来删除表格的边框样式。</td>
</tr>
<tr>
<td>sortClass</td>
<td>data-sort-class</td>
<td>String</td>
<td>undefined</td>
<td>被排序的td元素的类名。</td>
</tr>
<tr>
<td>height</td>
<td>data-height</td>
<td>Number</td>
<td>undefined</td>
<td>定义表格的高度。</td>
</tr>
<tr>
<td>undefinedText</td>
<td>data-undefined-text</td>
<td>String</td>
<td>'-'</td>
<td>当数据为 undefined 时显示的字符。</td>
</tr>
<tr>
<td>striped</td>
<td>data-striped</td>
<td>Boolean</td>
<td>false</td>
<td>设置为 <code>true</code> 会有隔行变色效果。</td>
</tr>
<tr>
<td>sortName</td>
<td>data-sort-name</td>
<td>String</td>
<td>undefined</td>
<td>定义排序列,通过url方式获取数据填写字段名,否则填写下标。</td>
</tr>
<tr>
<td>sortOrder</td>
<td>data-sort-order</td>
<td>String</td>
<td>'asc'</td>
<td>定义排序方式,'asc' 或者 'desc'。</td>
</tr>
<tr>
<td>sortStable</td>
<td>data-sort-stable</td>
<td>Boolean</td>
<td>false</td>
<td>设置为 <code>true</code> 将获得稳定的排序,我们会添加<code>\_position</code>属性到 row 数据中。</td>
</tr>
<tr>
<td>iconsPrefix</td>
<td>data-icons-prefix</td>
<td>String</td>
<td>'glyphicon'</td>
<td>定义字体库 ('Glyphicon' or 'fa' for FontAwesome),使用"fa"时需引用 FontAwesome,并且配合 icons
属性实现效果。<br/>
Glyphicon 集成于Bootstrap可免费使用,参考: <a href="http://glyphicons.com/" rel="nofollow">http://glyphicons.com/</a><br/>
FontAwesome 参考: <a href="http://fortawesome.github.io/" rel="nofollow">http://fortawesome.github.io/</a>
</td>
</tr>
<tr>
<td>icons</td>
<td>data-icons</td>
<td>Object</td>
<td>{<br/>
paginationSwitchDown: 'glyphicon-collapse-down icon-chevron-down',<br/>
paginationSwitchUp: 'glyphicon-collapse-up icon-chevron-up',<br/>
refresh: 'glyphicon-refresh icon-refresh'<br/>
toggle: 'glyphicon-list-alt icon-list-alt'<br/>
columns: 'glyphicon-th icon-th'<br/>
detailOpen: 'glyphicon-plus icon-plus'<br/>
detailClose: 'glyphicon-minus icon-minus'<br/>
}
</td>
<td>自定义图标</td>
</tr>
<tr>
<td>columns</td>
<td>-</td>
<td>Array</td>
<td>[]</td>
<td>列配置项,详情请查看 列参数 表格.</td>
</tr>
<tr>
<td>data</td>
<td>-</td>
<td>Array</td>
<td>[]</td>
<td>加载json格式的数据。</td>
</tr>
<tr>
<td>ajax</td>
<td>data-ajax</td>
<td>Function</td>
<td>undefined</td>
<td>自定义 AJAX 方法,须实现 jQuery AJAX API。</td>
</tr>
<tr>
<td>method</td>
<td>data-method</td>
<td>String</td>
<td>'get'</td>
<td>服务器数据的请求方式 'get' 或 'post'。</td>
</tr>
<tr>
<td>url</td>
<td>data-url</td>
<td>String</td>
<td>undefined</td>
<td>服务器数据的加载地址。</td>
</tr>
<tr>
<td>cache</td>
<td>data-cache</td>
<td>Boolean</td>
<td>true</td>
<td>设置为 <code>false</code> 禁用 AJAX 数据缓存。</td>
</tr>
<tr>
<td>contentType</td>
<td>data-content-type</td>
<td>String</td>
<td>'application/json'</td>
<td>发送到服务器的数据编码类型。</td>
</tr>
<tr>
<td>dataType</td>
<td>data-data-type</td>
<td>String</td>
<td>'json'</td>
<td>服务器返回的数据类型。</td>
</tr>
<tr>
<td>ajaxOptions</td>
<td>data-ajax-options</td>
<td>Object</td>
<td>{}</td>
<td>提交ajax请求时的附加参数,可用参数列请查看<a href="http://api.jquery.com/jQuery.ajax" rel="nofollow">http://api.jquery.com/jQuery.ajax</a>.
</td>
</tr>
<tr>
<td>queryParams</td>
<td>data-query-params</td>
<td>Function</td>
<td>function(params) {<br/>
return params;<br/>
}
</td>
<td>请求服务器数据时,你可以通过重写参数的方式添加一些额外的参数,例如 toolbar 中的参数 如果 queryParamsType = 'limit'
,返回参数必须包含<br/>
limit, offset, search, sort, order 否则, 需要包含: <br/>
pageSize, pageNumber, searchText, sortName, sortOrder. <br/>
返回false将会终止请求。
</td>
</tr>
<tr>
<td>queryParamsType</td>
<td>data-query-params-type</td>
<td>String</td>
<td>'limit'</td>
<td>设置为 'limit' 则会发送符合 RESTFul 格式的参数。</td>
</tr>
<tr>
<td>responseHandler</td>
<td>data-response-handler</td>
<td>Function</td>
<td>function(res) {<br/>
return res;<br/>
}
</td>
<td>加载服务器数据之前的处理程序,可以用来格式化数据。<br/>
参数:res为从服务器请求到的数据。
</td>
</tr>
<tr>
<td>pagination</td>
<td>data-pagination</td>
<td>Boolean</td>
<td>false</td>
<td>设置为 <code>true</code> 会在表格底部显示分页条。</td>
</tr>
<tr>
<td>paginationLoop</td>
<td>data-pagination-loop</td>
<td>Boolean</td>
<td>true</td>
<td>设置为 <code>true</code> 启用分页条无限循环的功能。</td>
</tr>
<tr>
<td>onlyInfoPagination</td>
<td>data-only-info-pagination</td>
<td>Boolean</td>
<td>false</td>
<td>设置为 <code>true</code> 只显示总数据数,而不显示分页按钮。需要设置 pagination='true'。</td>
</tr>
<tr>
<td>sidePagination</td>
<td>data-side-pagination</td>
<td>String</td>
<td>'client'</td>
<td>设置在哪里进行分页,可选值为 'client' 或者 'server'。设置 'server'时,必须设置服务器数据地址(url)或者重写ajax方法。</td>
</tr>
<tr>
<td>pageNumber</td>
<td>data-page-number</td>
<td>Number</td>
<td>1</td>
<td>如果设置了分页,首页页码。</td>
</tr>
<tr>
<td>pageSize</td>
<td>data-page-size</td>
<td>Number</td>
<td>10</td>
<td>如果设置了分页,页面数据条数。</td>
</tr>
<tr>
<td>pageList</td>
<td>data-page-list</td>
<td>Array</td>
<td>[10, 25, 50, 100, All]</td>
<td>如果设置了分页,设置可供选择的页面数据条数。设置为 All 或者 Unlimited,则显示所有记录。</td>
</tr>
<tr>
<td>selectItemName</td>
<td>data-select-item-name</td>
<td>String</td>
<td>'btSelectItem'</td>
<td>radio 或者 checkbox 的字段 name 名。</td>
</tr>
<tr>
<td>smartDisplay</td>
<td>data-smart-display</td>
<td>Boolean</td>
<td>true</td>
<td>设置为 true 是程序自动判断显示分页信息和 card 视图。</td>
</tr>
<tr>
<td>escape</td>
<td>data-escape</td>
<td>Boolean</td>
<td>false</td>
<td>转义HTML字符串,替换 <code>&amp;</code>, <code>&lt;</code>, <code>&gt;</code>,
<code>"</code>, <code>\`</code>, 和 <code>'</code> 字符。
</td>
</tr>
<tr>
<td>search</td>
<td>data-search</td>
<td>Boolean</td>
<td>false</td>
<td>是否启用搜索框。</td>
</tr>
<tr>
<td>searchOnEnterKey</td>
<td>data-search-on-enter-key</td>
<td>Boolean</td>
<td>false</td>
<td>设置为 <code>true</code>时,按回车触发搜索方法,否则自动触发搜索方法。</td>
</tr>
<tr>
<td>strictSearch</td>
<td>data-strict-search</td>
<td>Boolean</td>
<td>false</td>
<td>设置为 <code>true</code>启用全匹配搜索,否则为模糊搜索。</td>
</tr>
<tr>
<td>searchText</td>
<td>data-search-text</td>
<td>String</td>
<td>''</td>
<td>初始化搜索文字。</td>
</tr>
<tr>
<td>searchTimeOut</td>
<td>data-search-time-out</td>
<td>Number</td>
<td>500</td>
<td>设置搜索超时时间。</td>
</tr>
<tr>
<td>trimOnSearch</td>
<td>data-trim-on-search</td>
<td>Boolean</td>
<td>true</td>
<td>设置为 <code>true</code> 将自动去掉搜索字符的前后空格。</td>
</tr>
<tr>
<td>showHeader</td>
<td>data-show-header</td>
<td>Boolean</td>
<td>true</td>
<td>是否显示列头。</td>
</tr>
<tr>
<td>showFooter</td>
<td>data-show-footer</td>
<td>Boolean</td>
<td>false</td>
<td>是否显示列脚。</td>
</tr>
<tr>
<td>showColumns</td>
<td>data-show-columns</td>
<td>Boolean</td>
<td>false</td>
<td>是否显示内容列下拉框。</td>
</tr>
<tr>
<td>showRefresh</td>
<td>data-show-refresh</td>
<td>Boolean</td>
<td>false</td>
<td>是否显示刷新按钮。</td>
</tr>
<tr>
<td>showToggle</td>
<td>data-show-toggle</td>
<td>Boolean</td>
<td>false</td>
<td>是否显示切换视图(table/card)按钮。</td>
</tr>
<tr>
<td>showPaginationSwitch</td>
<td>data-show-pagination-switch</td>
<td>Boolean</td>
<td>false</td>
<td>是否显示切换分页按钮。</td>
</tr>
<tr>
<td>showFullscreen</td>
<td>data-show-fullscreen</td>
<td>Boolean</td>
<td>false</td>
<td>是否显示全屏按钮。</td>
</tr>
<tr>
<td>minimumCountColumns</td>
<td>data-minimum-count-columns</td>
<td>Number</td>
<td>1</td>
<td>最小隐藏列的数量。</td>
</tr>
<tr>
<td>idField</td>
<td>data-id-field</td>
<td>String</td>
<td>undefined</td>
<td>指定主键列。</td>
</tr>
<tr>
<td>uniqueId</td>
<td>data-unique-id</td>
<td>String</td>
<td>undefined</td>
<td>对每一行指定唯一标识符。</td>
</tr>
<tr>
<td>cardView</td>
<td>data-card-view</td>
<td>Boolean</td>
<td>false</td>
<td>设置为 <code>true</code>将显示card视图,适用于移动设备。否则为table试图,适用于pc端。</td>
</tr>
<tr>
<td>detailView</td>
<td>data-detail-view</td>
<td>Boolean</td>
<td>false</td>
<td>设置为 <code>true</code> 可以显示详细页面模式。</td>
</tr>
<tr>
<td>detailFormatter</td>
<td>data-detail-formatter</td>
<td>Function</td>
<td>function(index, row) {<br/>
return '';<br/>
}
</td>
<td>格式化详细页面模式的视图。</td>
</tr>
<tr>
<td>searchAlign</td>
<td>data-search-align</td>
<td>String</td>
<td>'right'</td>
<td>指定 搜索框 水平方向的位置。'left' 或 'right'。</td>
</tr>
<tr>
<td>buttonsAlign</td>
<td>data-buttons-align</td>
<td>String</td>
<td>'right'</td>
<td>指定 按钮栏 水平方向的位置。'left' 或 'right'。</td>
</tr>
<tr>
<td>toolbarAlign</td>
<td>data-toolbar-align</td>
<td>String</td>
<td>'left'</td>
<td>指定 toolbar 水平方向的位置。'left' 或 'right'。</td>
</tr>
<tr>
<td>paginationVAlign</td>
<td>data-pagination-v-align</td>
<td>String</td>
<td>'bottom'</td>
<td>指定 分页条 在垂直方向的位置。'top','bottom' 或 'both'。</td>
</tr>
<tr>
<td>paginationHAlign</td>
<td>data-pagination-h-align</td>
<td>String</td>
<td>'right'</td>
<td>指定 分页条 在水平方向的位置。'left' 或 'right'。</td>
</tr>
<tr>
<td>paginationDetailHAlign</td>
<td>data-pagination-detail-h-align</td>
<td>String</td>
<td>'left'</td>
<td>指定 分页详细信息 在水平方向的位置。'left' 或 'right'。</td>
</tr>
<tr>
<td>paginationPreText</td>
<td>data-pagination-pre-text</td>
<td>String</td>
<td>'&lt;'</td>
<td>指定分页条中上一页按钮的图标或文字。</td>
</tr>
<tr>
<td>paginationNextText</td>
<td>data-pagination-next-text</td>
<td>String</td>
<td>'&gt;'</td>
<td>指定分页条中下一页按钮的图标或文字。</td>
</tr>
<tr>
<td>clickToSelect</td>
<td>data-click-to-select</td>
<td>Boolean</td>
<td>false</td>
<td>设置 true 将在点击行时,自动选择 rediobox 和 checkbox。</td>
</tr>
<tr>
<td>ignoreClickToSelectOn</td>
<td>data-ignore-click-to-select-on</td>
<td>Function</td>
<td><code>{ return $.inArray(element.tagName, ['A', 'BUTTON']); }</code></td>
<td>包含一个参数:<br/>
element: 点击的元素。<br/>
返回 true 是点击事件会被忽略,返回 false 将会自动选中。该选项只有在 clickToSelect 为 true 时才生效。
</td>
</tr>
<tr>
<td>singleSelect</td>
<td>data-single-select</td>
<td>Boolean</td>
<td>false</td>
<td>设置 true 将禁止多选。</td>
</tr>
<tr>
<td>toolbar</td>
<td>data-toolbar</td>
<td>String</td>
<td>undefined</td>
<td>一个jQuery 选择器,指明自定义的 toolbar。例如:<br/>
#toolbar, .toolbar.
</td>
</tr>
<tr>
<td>buttonsToolbar</td>
<td>data-buttons-toolbar</td>
<td>String | Node</td>
<td>undefined</td>
<td>一个jQuery 选择器,指明自定义的 buttons toolbar。例如:<br/>
#buttons-toolbar, .buttons-toolbar 或 DOM 节点。
</td>
</tr>
<tr>
<td>checkboxHeader</td>
<td>data-checkbox-header</td>
<td>Boolean</td>
<td>true</td>
<td>设置 false 将在列头隐藏全选复选框。</td>
</tr>
<tr>
<td>maintainSelected</td>
<td>data-maintain-selected</td>
<td>Boolean</td>
<td>false</td>
<td>设置为 <code>true</code> 在点击分页按钮或搜索按钮时,将记住checkbox的选择项。</td>
</tr>
<tr>
<td>sortable</td>
<td>data-sortable</td>
<td>Boolean</td>
<td>true</td>
<td>设置为<code>false</code> 将禁止所有列的排序。</td>
</tr>
<tr>
<td>silentSort</td>
<td>data-silent-sort</td>
<td>Boolean</td>
<td>true</td>
<td>设置为 <code>false</code> 将在点击分页按钮时,自动记住排序项。仅在 sidePagination设置为 <code>server</code>时生效。
</td>
</tr>
<tr>
<td>rowStyle</td>
<td>data-row-style</td>
<td>Function</td>
<td>function(row,index) {<br/>
return class;<br/>
}
</td>
<td>自定义行样式 参数为:<br/>
row: 行数据<br/>
index: 行下标<br/>
返回值可以为class或者css
</td>
</tr>
<tr>
<td>rowAttributes</td>
<td>data-row-attributes</td>
<td>Function</td>
<td>function(row,index) {<br/>
return attributes;<br/>
}
</td>
<td>自定义行属性 参数为:<br/>
row: 行数据<br/>
index: 行下标<br/>
返回值可以为class或者css 支持所有自定义属性
</td>
</tr>
<tr>
<td>customSearch</td>
<td>data-custom-search</td>
<td>Function</td>
<td>$.noop</td>
<td>自定义搜索方法来替代内置的搜索功能,它包含一个参数:<br/>
text:搜索文字。<br/>
用法示例:
<pre>
function customSearch(text) {
//Search logic here.
//You must use `this.data` array in order to filter the data. NO use `this.options.data`.
}
</pre>
</td>
</tr>
<tr>
<td>customSort</td>
<td>data-custom-sort</td>
<td>Function</td>
<td>$.noop</td>
<td>自定义排序方法来替代内置的搜索功能,它包含一个参数:<br/>
sortName: 排序名。<br/>
sortOrder: 排序顺序。<br/>
用法示例:
<pre>
function customSort(sortName, sortOrder) {
//Sort logic here.
//You must use `this.data` array in order to sort the data. NO use `this.options.data`.
}
</pre>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>列参数</h5>
<p class="text-right">列参数定义在 jQuery.fn.bootstrapTable.columnDefaults</p>
</div>
<div class="ibox-content">
<!-- table内容 -->
<table data-toggle="table" data-mobile-responsive="true">
<thead>
<tr>
<th>名称</th>
<th>属性</th>
<th>类型</th>
<th>默认</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>radio</td>
<td>data-radio</td>
<td>Boolean</td>
<td>false</td>
<td>True to show a radio. The radio column has fixed width.</td>
</tr>
<tr>
<td>checkbox</td>
<td>data-checkbox</td>
<td>Boolean</td>
<td>false</td>
<td>True to show a checkbox. The checkbox column has fixed width.</td>
</tr>
<tr>
<td>field</td>
<td>data-field</td>
<td>String</td>
<td>undefined</td>
<td>The column field name.</td>
</tr>
<tr>
<td>title</td>
<td>data-title</td>
<td>String</td>
<td>undefined</td>
<td>The column title text.</td>
</tr>
<tr>
<td>titleTooltip</td>
<td>data-title-tooltip</td>
<td>String</td>
<td>undefined</td>
<td>The column title tooltip text. This option also support the title HTML attribute
</td>
</tr>
<tr>
<td>class</td>
<td>class / data-class</td>
<td>String</td>
<td>undefined</td>
<td>The column class name.</td>
</tr>
<tr>
<td>rowspan</td>
<td>rowspan / data-rowspan</td>
<td>Number</td>
<td>undefined</td>
<td>Indicate how many rows a cell should take up.</td>
</tr>
<tr>
<td>colspan</td>
<td>colspan / data-colspan</td>
<td>Number</td>
<td>undefined</td>
<td>Indicate how many columns a cell should take up.</td>
</tr>
<tr>
<td>align</td>
<td>data-align</td>
<td>String</td>
<td>undefined</td>
<td>Indicate how to align the column data. 'left', 'right', 'center' can be used.</td>
</tr>
<tr>
<td>halign</td>
<td>data-halign</td>
<td>String</td>
<td>undefined</td>
<td>Indicate how to align the table header. 'left', 'right', 'center' can be used.</td>
</tr>
<tr>
<td>falign</td>
<td>data-falign</td>
<td>String</td>
<td>undefined</td>
<td>Indicate how to align the table footer. 'left', 'right', 'center' can be used.</td>
</tr>
<tr>
<td>valign</td>
<td>data-valign</td>
<td>String</td>
<td>undefined</td>
<td>Indicate how to align the cell data. 'top', 'middle', 'bottom' can be used.</td>
</tr>
<tr>
<td>width</td>
<td>data-width</td>
<td>Number {Pixels or Percentage}</td>
<td>undefined</td>
<td>The width of column. If not defined, the width will auto expand to fit its contents.
Also you can add '%' to your number and the bootstrapTable will use the percentage
unit, otherwise, you can add or no the 'px' to your number and then the
bootstrapTable will use the pixels
</td>
</tr>
<tr>
<td>sortable</td>
<td>data-sortable</td>
<td>Boolean</td>
<td>false</td>
<td>True to allow the column can be sorted.</td>
</tr>
<tr>
<td>order</td>
<td>data-order</td>
<td>String</td>
<td>'asc'</td>
<td>The default sort order, can only be 'asc' or 'desc'.</td>
</tr>
<tr>
<td>visible</td>
<td>data-visible</td>
<td>Boolean</td>
<td>true</td>
<td>False to hide the columns item.</td>
</tr>
<tr>
<td>cardVisible</td>
<td>data-card-visible</td>
<td>Boolean</td>
<td>true</td>
<td>False to hide the columns item in card view state.</td>
</tr>
<tr>
<td>switchable</td>
<td>data-switchable</td>
<td>Boolean</td>
<td>true</td>
<td>False to disable the switchable of columns item.</td>
</tr>
<tr>
<td>clickToSelect</td>
<td>data-click-to-select</td>
<td>Boolean</td>
<td>true</td>
<td>True to select checkbox or radiobox when the column is clicked.</td>
</tr>
<tr>
<td>formatter</td>
<td>data-formatter</td>
<td>Function</td>
<td>undefined</td>
<td>The context (this) is the column Object. <br/>
The cell formatter function, take three parameters: <br/>
value: the field value. <br/>
row: the row record data.<br/>
index: the row index.
</td>
</tr>
<tr>
<td>footerFormatter</td>
<td>data-footer-formatter</td>
<td>Function</td>
<td>undefined</td>
<td>The context (this) is the column Object. <br/>
The function, take one parameter: <br/>
data: Array of all the data rows. <br/>
the function should return a string with the text to show in the footer cell.
</td>
</tr>
<tr>
<td>events</td>
<td>data-events</td>
<td>Object</td>
<td>undefined</td>
<td>The cell events listener when you use formatter function, take three parameters:
<br/>
event: the jQuery event. <br/>
value: the field value. <br/>
row: the row record data.<br/>
index: the row index.
</td>
</tr>
<tr>
<td>sorter</td>
<td>data-sorter</td>
<td>Function</td>
<td>undefined</td>
<td>The custom field sort function that used to do local sorting, take two parameters:
<br/>
a: the first field value.<br/>
b: the second field value.<br/>
rowA: the first row.<br/>
rowB: the second row.
</td>
</tr>
<tr>
<td>sortName</td>
<td>data-sort-name</td>
<td>String</td>
<td>undefined</td>
<td>Provide a customizable sort-name, not the default sort-name in the header, or the
field name of the column. For example, a column might display the value of fieldName
of "html" such as "&lt;b&gt;&lt;span &gt;abc&lt;/span&gt;&lt;/b&gt;", but a
fieldName to sort is "content" with the value of "abc".
</td>
</tr>
<tr>
<td>cellStyle</td>
<td>data-cell-style</td>
<td>Function</td>
<td>undefined</td>
<td>The cell style formatter function, take three parameters: <br/>
value: the field value.<br/>
row: the row record data.<br/>
index: the row index.<br/>
field: the row field.<br/>
Support classes or css.
</td>
</tr>
<tr>
<td>searchable</td>
<td>data-searchable</td>
<td>Boolean</td>
<td>true</td>
<td>True to search data for this column.</td>
</tr>
<tr>
<td>searchFormatter</td>
<td>data-search-formatter</td>
<td>Boolean</td>
<td>true</td>
<td>True to search use formated data.</td>
</tr>
<tr>
<td>escape</td>
<td>data-escape</td>
<td>Boolean</td>
<td>false</td>
<td>Escapes a string for insertion into HTML, replacing &amp;, &lt;, &gt;, ", \`, and '
characters.
</td>
</tr>
<tr>
<td>showSelectTitle</td>
<td>data-show-select-title</td>
<td>Boolean</td>
<td>false</td>
<td>True to show the title of column with 'radio' or 'singleSelect' 'checkbox' option.
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>事件</h5>
</div>
<div class="ibox-content">
<table data-toggle="table" data-mobile-responsive="true">
<thead>
<tr>
<th>Option 事件</th>
<th>jQuery 事件</th>
<th>参数</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>onAll</td>
<td>all.bs.table</td>
<td>name, args</td>
<td>所有的事件都会触发该事件,参数包括:<br/>
name:事件名,<br/>
args:事件的参数。
</td>
</tr>
<tr>
<td>onClickRow</td>
<td>click-row.bs.table</td>
<td>row, $element</td>
<td>当用户点击某一行的时候触发,参数包括:<br/>
row:点击行的数据,<br/>
$element:tr 元素,<br/>
field:点击列的 field 名称。
</td>
</tr>
<tr>
<td>onDblClickRow</td>
<td>dbl-click-row.bs.table</td>
<td>row, $element</td>
<td>当用户双击某一行的时候触发,参数包括:<br/>
row:点击行的数据,<br/>
$element:tr 元素,<br/>
field:点击列的 field 名称。
</td>
</tr>
<tr>
<td>onClickCell</td>
<td>click-cell.bs.table</td>
<td>field, value, row, $element</td>
<td>当用户点击某一列的时候触发,参数包括:<br/>
field:点击列的 field 名称,<br/>
value:点击列的 value 值,<br/>
row:点击列的整行数据,<br/>
$element:td 元素。
</td>
</tr>
<tr>
<td>onDblClickCell</td>
<td>dbl-click-cell.bs.table</td>
<td>field, value, row, $element</td>
<td>当用户双击某一列的时候触发,参数包括:<br/>
field:点击列的 field 名称,<br/>
value:点击列的 value 值,<br/>
row:点击列的整行数据,<br/>
$element:td 元素。
</td>
</tr>
<tr>
<td>onSort</td>
<td>sort.bs.table</td>
<td>name, order</td>
<td>当用户对某列进行排序时触发,参数包括:<br/>
name:排序列的 filed 名称,<br/>
order:排序顺序。
</td>
</tr>
<tr>
<td>onCheck</td>
<td>check.bs.table</td>
<td>row</td>
<td>当用户选择某一行时触发,参数包含:<br/>
row:与点击行对应的记录,<br/>
$element:选择的DOM元素。
</td>
</tr>
<tr>
<td>onUncheck</td>
<td>uncheck.bs.table</td>
<td>row</td>
<td>当用户反选某一行时触发,参数包含:<br/>
row:与点击行对应的记录,<br/>
$element:选择的DOM元素。
</td>
</tr>
<tr>
<td>onCheckAll</td>
<td>check-all.bs.table</td>
<td>rows</td>
<td>当用户全选所有的行时触发,参数包含:<br/>
rows:最新选择的所有行的数组。
</td>
</tr>
<tr>
<td>onUncheckAll</td>
<td>uncheck-all.bs.table</td>
<td>rows</td>
<td>当用户反选所有的行时触发,参数包含:<br/>
rows:最新选择的所有行的数组。
</td>
</tr>
<tr>
<td>onCheckSome</td>
<td>check-some.bs.table</td>
<td>rows</td>
<td>当用户选择某些行时触发,参数包含:<br/>
rows:相对于之前选择的行的数组。
</td>
</tr>
<tr>
<td>onUncheckSome</td>
<td>uncheck-some.bs.table</td>
<td>rows</td>
<td>当用户反选某些行时触发,参数包含:<br/>
rows:相对于之前选择的行的数组。
</td>
</tr>
<tr>
<td>onLoadSuccess</td>
<td>load-success.bs.table</td>
<td>data</td>
<td>远程数据加载成功时触发成功。</td>
</tr>
<tr>
<td>onLoadError</td>
<td>load-error.bs.table</td>
<td>status</td>
<td>远程数据加载失败时触发成功。</td>
</tr>
<tr>
<td>onColumnSwitch</td>
<td>column-switch.bs.table</td>
<td>field, checked</td>
<td>当切换列的时候触发。</td>
</tr>
<tr>
<td>onColumnSearch</td>
<td>column-search.bs.table</td>
<td>field, text</td>
<td>当搜索列时触发。</td>
</tr>
<tr>
<td>onPageChange</td>
<td>page-change.bs.table</td>
<td>number, size</td>
<td>当页面更改页码或页面大小时触发。</td>
</tr>
<tr>
<td>onSearch</td>
<td>search.bs.table</td>
<td>text</td>
<td>当搜索表格时触发。</td>
</tr>
<tr>
<td>onToggle</td>
<td>toggle.bs.table</td>
<td>cardView</td>
<td>切换表格视图时触发。</td>
</tr>
<tr>
<td>onPreBody</td>
<td>pre-body.bs.table</td>
<td>data</td>
<td>在表格 body 渲染之前触发。</td>
</tr>
<tr>
<td>onPostBody</td>
<td>post-body.bs.table</td>
<td>none</td>
<td>在表格 body 渲染完成后触发。</td>
</tr>
<tr>
<td>onPostHeader</td>
<td>post-header.bs.table</td>
<td>none</td>
<td>在表格 header 渲染完成后触发。</td>
</tr>
<tr>
<td>onExpandRow</td>
<td>expand-row.bs.table</td>
<td>index, row, $detail</td>
<td>当点击详细图标展开详细页面的时候触发。</td>
</tr>
<tr>
<td>onCollapseRow</td>
<td>collapse-row.bs.table</td>
<td>index, row</td>
<td>当点击详细图片收起详细页面的时候触发。</td>
</tr>
<tr>
<td>onRefreshOptions</td>
<td>refresh-options.bs.table</td>
<td>options</td>
<td>刷新选项之后并在销毁和初始化表之前触发。</td>
</tr>
<tr>
<td>onRefresh</td>
<td>refresh.bs.table</td>
<td>params</td>
<td>点击刷新按钮后触发。</td>
</tr>
<tr>
<td>onScrollBody</td>
<td>scroll-body.bs.table</td>
<td></td>
<td>表格 body 滚动时触发。</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>方法</h5>
<p class="text-right">使用方法的语法:<code>$('#table').bootstrapTable('method', parameter);</code></p>
</div>
<div class="ibox-content">
<table data-toggle="table" data-mobile-responsive="true">
<thead>
<tr>
<th>名称</th>
<th>参数</th>
<th>描述</th>
<th>例子</th>
</tr>
</thead>
<tbody>
<tr>
<td>getOptions</td>
<td>none</td>
<td>返回表格的 Options。</td>
<td>getOptions</td>
</tr>
<tr>
<td>getSelections</td>
<td>none</td>
<td>返回所选的行,当没有选择任何行的时候返回一个空数组。</td>
<td>getSelections</td>
</tr>
<tr>
<td>getAllSelections</td>
<td>none</td>
<td>返回所有选择的行,包括搜索过滤前的,当没有选择任何行的时候返回一个空数组。</td>
<td>getAllSelections</td>
</tr>
<tr>
<td>getData</td>
<td>useCurrentPage</td>
<td>或者当前加载的数据。假如设置 useCurrentPage 为 true,则返回当前页的数据。</td>
<td>getData</td>
</tr>
<tr>
<td>getRowByUniqueId</td>
<td>id</td>
<td>根据 uniqueId 获取行数据。</td>
<td>getRowByUniqueId</td>
</tr>
<tr>
<td>load</td>
<td>data</td>
<td>加载数据到表格中,旧数据会被替换。</td>
<td>load</td>
</tr>
<tr>
<td>showAllColumns</td>
<td>none</td>
<td>显示所有列。</td>
<td>showAllColumns</td>
</tr>
<tr>
<td>hideAllColumns</td>
<td>none</td>
<td>隐藏所有列。</td>
<td>hidAllColumns</td>
</tr>
<tr>
<td>append</td>
<td>data</td>
<td>添加数据到表格在现有数据之后。</td>
<td>append</td>
</tr>
<tr>
<td>prepend</td>
<td>data</td>
<td>插入数据到表格在现有数据之前。</td>
<td>prepend</td>
</tr>
<tr>
<td>remove</td>
<td>params</td>
<td>从表格中删除数据,包括两个参数: field: 需要删除的行的 field 名称,<br/>
values: 需要删除的行的值,类型为数组。
</td>
<td>remove</td>
</tr>
<tr>
<td>removeAll</td>
<td>-</td>
<td>删除表格所有数据。</td>
<td>removeAll</td>
</tr>
<tr>
<td>removeByUniqueId</td>
<td>id</td>
<td>根据 uniqueId 删除指定的行。</td>
<td>removeByUniqueId</td>
</tr>
<tr>
<td>insertRow</td>
<td>params</td>
<td>插入新行,参数包括:<br/>
index: 要插入的行的 index,<br/>
row: 行的数据,Object 对象。
</td>
<td>insertRow</td>
</tr>
<tr>
<td>updateRow</td>
<td>params</td>
<td>更新指定的行,参数包括:<br/>
index: 要更新的行的 index,<br/>
row: 行的数据,Object 对象。
</td>
<td>updateRow</td>
</tr>
<tr>
<td>showRow</td>
<td>params</td>
<td>显示指定的行,参数包括:<br/>
index: 要更新的行的 index 或者 uniqueId,<br/>
isIdField: 指定 index 是否为 uniqueid。
</td>
<td>showRow-hideRow</td>
</tr>
<tr>
<td>hideRow</td>
<td>params</td>
<td>显示指定的行,参数包括:<br/>
index: 要更新的行的 index,<br/>
uniqueId: 或者要更新的行的 uniqueid。
</td>
<td>showRow-hideRow</td>
</tr>
<tr>
<td>getHiddenRows</td>
<td>show</td>
<td>获取所有隐藏的行,如果show参数为true,行将再次显示,否则,只返回隐藏的行。</td>
</tr>
<tr>
<td>mergeCells</td>
<td>options</td>
<td>将某些单元格合并到一个单元格,选项包含以下属性: <br/>
index: 行索引,<br/>
field: 字段名称,<br/>
rowspan: 要合并的rowspan数量,<br/>
colspan: 要合并的colspan数量。
</td>
</tr>
<tr>
<td>updateCell</td>
<td>params</td>
<td>更新一个单元格,params包含以下属性:<br/>
index: 行索引。<br/>
field: 字段名称。<br/>
value: 新字段值。
</td>
</tr>
<tr>
<td>refresh</td>
<td>params</td>
<td>刷新远程服务器数据,可以设置<code>{silent: true}</code>以静默方式刷新数据,并设置<code>{url: newUrl}</code>更改URL。
要提供特定于此请求的查询参数,请设置<code>{query: {foo: 'bar'}}</code>
</td>
</tr>
<tr>
<td>refreshOptions</td>
<td>options</td>
<td>刷新选项。</td>
</tr>
<tr>
<td>resetSearch</td>
<td>text</td>
<td>设置搜索文本。</td>
</tr>
<tr>
<td>showLoading</td>
<td>none</td>
<td>显示加载状态。</td>
</tr>
<tr>
<td>hideLoading</td>
<td>none</td>
<td>隐藏加载状态。</td>
</tr>
<tr>
<td>checkAll</td>
<td>none</td>
<td>选中当前页面所有行。</td>
</tr>
<tr>
<td>uncheckAll</td>
<td>none</td>
<td>取消选中当前页面所有行。</td>
</tr>
<tr>
<td>check</td>
<td>index</td>
<td>选中某一行,行索引从0开始。</td>
</tr>
<tr>
<td>uncheck</td>
<td>index</td>
<td>取消选中某一行,行索引从0开始。</td>
</tr>
<tr>
<td>checkBy</td>
<td>params</td>
<td>按值或数组选中某行,参数包含:<br/>
field: 用于查找记录的字段的名称,<br/>
values: 要检查的行的值数组。<br/>
例子: <br/>
$("#table").bootstrapTable("checkBy", {field:"field_name",
values:["value1","value2","value3"]})
</td>
</tr>
<tr>
<td>uncheckBy</td>
<td>params</td>
<td>按值数组取消选中某行,参数包含:<br/>
field: 用于查找记录的字段的名称,<br/>
values: 要检查的行的值数组。<br/>
例子: <br/>
$("#table").bootstrapTable("uncheckBy", {field:"field_name",
values:["value1","value2","value3"]})
</td>
</tr>
<tr>
<td>resetView</td>
<td>params</td>
<td>重置引导表视图,例如重置表高度。</td>
</tr>
<tr>
<td>resetWidth</td>
<td>none</td>
<td>调整页眉和页脚的大小以适合当前列宽度。</td>
</tr>
<tr>
<td>destroy</td>
<td>none</td>
<td>销毁表。</td>
</tr>
<tr>
<td>showColumn</td>
<td>field</td>
<td>显示指定的列。</td>
</tr>
<tr>
<td>hideColumn</td>
<td>field</td>
<td>隐藏指定的列。</td>
</tr>
<tr>
<td>getHiddenColumns</td>
<td>-</td>
<td>获取隐藏的列。</td>
</tr>
<tr>
<td>getVisibleColumns</td>
<td>-</td>
<td>获取可见列。</td>
</tr>
<tr>
<td>scrollTo</td>
<td>value</td>
<td>滚动到指定位置,单位为 px,设置 'bottom' 表示跳到最后。</td>
</tr>
<tr>
<td>getScrollPosition</td>
<td>none</td>
<td>获取当前滚动条的位置,单位为 px。</td>
</tr>
<tr>
<td>filterBy</td>
<td>params</td>
<td>(只能用于 client 端)过滤表格数据, 你可以通过过滤<code>{age: 10}</code>来显示 age 等于 10 的数据。</td>
</tr>
<tr>
<td>selectPage</td>
<td>page</td>
<td>跳到指定的页。</td>
</tr>
<tr>
<td>prevPage</td>
<td>none</td>
<td>跳到上一页。</td>
</tr>
<tr>
<td>nextPage</td>
<td>none</td>
<td>跳到下一页。</td>
</tr>
<tr>
<td>togglePagination</td>
<td>none</td>
<td>切换分页选项。</td>
</tr>
<tr>
<td>toggleView</td>
<td>none</td>
<td>切换 card/table 视图</td>
</tr>
<tr>
<td>expandRow</td>
<td>index</td>
<td>如果详细视图选项设置为True,可展开索引为 index 的行。</td>
</tr>
<tr>
<td>collapseRow</td>
<td>index</td>
<td>如果详细视图选项设置为True,可收起索引为 index 的行。.</td>
</tr>
<tr>
<td>expandAllRows</td>
<td>none</td>
<td>如果详细视图选项设置为True,可展开所有行。</td>
</tr>
<tr>
<td>collapseAllRows</td>
<td>none</td>
<td>如果详细视图选项设置为True,可收起开所有行。</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>多语言</h5>
</div>
<div class="ibox-content">
<table data-toggle="table">
<thead>
<tr>
<th>Name</th>
<th>Parameter</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>formatLoadingMessage</td>
<td>-</td>
<td>'Loading, please wait…'</td>
</tr>
<tr>
<td>formatRecordsPerPage</td>
<td>pageNumber</td>
<td>'%s records per page'</td>
</tr>
<tr>
<td>formatShowingRows</td>
<td>pageFrom, pageTo, totalRows</td>
<td>'Showing %s to %s of %s rows'</td>
</tr>
<tr>
<td>formatDetailPagination</td>
<td>totalRows</td>
<td>'Showing %s rows'</td>
</tr>
<tr>
<td>formatSearch</td>
<td>-</td>
<td>'Search'</td>
</tr>
<tr>
<td>formatNoMatches</td>
<td>-</td>
<td>'No matching records found'</td>
</tr>
<tr>
<td>formatRefresh</td>
<td>-</td>
<td>'Refresh'</td>
</tr>
<tr>
<td>formatToggle</td>
<td>-</td>
<td>'Toggle'</td>
</tr>
<tr>
<td>formatColumns</td>
<td>-</td>
<td>'Columns'</td>
</tr>
<tr>
<td>formatAllRows</td>
<td>-</td>
<td>'All'</td>
</tr>
<tr>
<td>formatFullscreen</td>
<td>-</td>
<td>'Fullscreen'</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>插件</h5>
</div>
<div class="ibox-content">
<table data-toggle="table">
<thead>
<tr>
<th>名称</th>
<th>使用(data-开头为html属性配置,其他为js options配置,可转换)</th>
<th>依赖</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>bootstrap-table-accent-neutralise</td>
<td>data-search-accent-neutralise="true"</td>
<td>data-search="true"</td>
<td>支持重音中和功能。在中文中不需要</td>
</tr>
<tr>
<td>bootstrap-table-addrbar</td>
<td>data-addrbar="true"</td>
<td>-</td>
<td>启用地址栏的查询参数。所有的查询过滤参数都会用get传参的方式显示在url上</td>
</tr>
<tr>
<td>bootstrap-table-auto-refresh</td>
<td>data-auto-refresh="true"</td>
<td>data-show-refresh="true"</td>
<td>自动刷新table</td>
</tr>
<tr>
<td>bootstrap-table-cookie</td>
<td>data-cookie="true" data-cookie-id-table="saveId" 保存后内容为saveId.bs.table.pageNumber=1</td>
<td>-</td>
<td>保存table的状态到cookie中</td>
</tr>
<tr>
<td>bootstrap-table-copy-rows</td>
<td>data-show-copy-rows="true"</td>
<td>column data-checkbox="true" 字段可选中</td>
<td>复制选中的行到剪切板</td>
</tr>
<tr>
<td>bootstrap-table-export</td>
<td>data-show-export="true"</td>
<td>tableExport.jquery.plugin</td>
<td>导出数据、支持导出全部、导出选择数据,导出格式支持json、xml、csv、text、sql、ms-excel、pdf</td>
</tr>
<tr>
<td>bootstrap-table-filter-control</td>
<td>data-filter-control="true" column 添加 data-filter-control="input" 或者 data-filter-control="select"</td>
<td>data-show-search-clear-button="true"</td>
<td>过滤列信息</td>
</tr>
<tr>
<td>bootstrap-table-fixed-columns</td>
<td>fixedColumns: true, fixedNumber: 1</td>
<td>-</td>
<td>固定表头、列头</td>
</tr>
<tr>
<td>bootstrap-table-i18n-enhance</td>
<td>$table.bootstrapTable('changeLocale', 'zh-CN'); $table.bootstrapTable('changeTitle', { id: '主键', name: '名称', price: '金额' });</td>
<td>bootstrap-table-locale-all.js</td>
<td>国际化切换、标题切换</td>
</tr>
<tr>
<td>bootstrap-table-key-events</td>
<td>data-key-events="true"</td>
<td>data-search="true"</td>
<td>按键盘直接输入search, 不用先选择search框</td>
</tr>
<tr>
<td>bootstrap-table-mobile</td>
<td>data-mobile-responsive="true" data-check-on-init="true"</td>
<td>-</td>
<td>在card和table视图之间更改视图</td>
</tr>
<tr>
<td>bootstrap-table-multiple-sort</td>
<td>data-show-multi-sort="true" data-sort-priority='[{"sortName": "github.count.forks","sortOrder":"desc"},{"sortName":"github.count.stargazers","sortOrder":"desc"}]'</td>
<td>-</td>
<td>使用多个字段排序</td>
</tr>
<tr>
<td>bootstrap-table-jump-to</td>
<td>data-show-jump-to="true"</td>
<td>data-pagination="true"</td>
<td>分页增加跳转到输入框和按钮</td>
</tr>
<tr>
<td>bootstrap-table-print</td>
<td>data-show-print="true"</td>
<td></td>
<td>打印机</td>
</tr>
<tr>
<td>bootstrap-table-reorder-columns</td>
<td></td>
<td>jquery插件 dragtable</td>
<td></td>
</tr>
<tr>
<td>bootstrap-table-resizable</td>
<td>data-resizable="true"</td>
<td>jquery插件 jquery-resizable-columns</td>
<td>列宽可拖动</td>
</tr>
<tr>
<td>bootstrap-table-sticky-header</td>
<td>stickyHeader: true, stickyHeaderOffsetLeft: '3em', stickyHeaderOffsetRight: '3em',</td>
<td>-</td>
<td>滚动时为表提供一个粘贴头</td>
</tr>
<tr>
<td>bootstrap-table-toolbar</td>
<td>data-advanced-search="true"</td>
<td>-</td>
<td>弹窗高级搜索</td>
</tr>
<tr>
<td>bootstrap-table-treegrid</td>
<td>
<pre class="text-left">
treeShowField: 'name',
parentIdField: 'pid',
onPostBody: function() {
var columns = $table.bootstrapTable('getOptions').columns
if (columns && columns[0][1].visible) {
$table.treegrid({
treeColumn: 1,
onChange: function() {
$table.bootstrapTable('resetWidth')
}
})
}
}
</pre>
</td>
<td>jquery插件 jquery-treegrid</td>
<td>树状table</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="footer fixed_full text-center">
<div>
<strong>Copyright</strong> 飘逸 &copy; 2019-2020
</div>
</div>
</div>
<script type="text/javascript" src="./node_modules/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="./node_modules/popper.js/dist/umd/popper.js"></script>
<script type="text/javascript" src="./node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
<script type="text/javascript" src="./node_modules/bootstrap-table/dist/bootstrap-table.min.js"></script>
<script type="text/javascript" src="./node_modules/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js"></script>
<!-- 自定义js内容 -->
<script type="text/javascript" src="./js/bootstrap-table-custom.js"></script>
<script>
$('#table').bootstrapTable({});
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/piaoyi95/bootstrap-table-example-study.git
git@gitee.com:piaoyi95/bootstrap-table-example-study.git
piaoyi95
bootstrap-table-example-study
bootstrap-table-example-study
master

搜索帮助