index.html 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <!-- Meta, title, CSS, favicons, etc. -->
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1">
  8. <meta name="description" content="An extended Bootstrap table with radio, checkbox, sort, pagination, and other added features.">
  9. <meta name="keywords" content="table, bootstrap, bootstrap plugin, bootstrap resources, bootstrap table, jQuery plugin">
  10. <meta name="author" content="Zhixin Wen, and Bootstrap table contributors">
  11. <title>
  12. Documentation &middot; Bootstrap Table
  13. </title>
  14. <!-- Bootstrap CSS -->
  15. <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
  16. <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="stylesheet">
  17. <link href="https://unpkg.com/bootstrap-table/dist/bootstrap-table.min.css" rel="stylesheet">
  18. <link href="../assets/css/docs.min.css" rel="stylesheet">
  19. <link href="../assets/css/sidenav.css?v=1.13.0" rel="stylesheet">
  20. <link href="../assets/css/style.css?v=1.13.0&m=2" rel="stylesheet">
  21. <link href="../assets/css/ads.css?m=3" rel="stylesheet">
  22. <!--[if lt IE 9]><script src="../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
  23. <script src="../assets/js/ie-emulation-modes-warning.js"></script>
  24. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  25. <!--[if lt IE 9]>
  26. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  27. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  28. <![endif]-->
  29. <!-- Favicons -->
  30. <link rel="apple-touch-icon" href="../favicon.png">
  31. <link rel="icon" href="../favicon.png">
  32. <script>
  33. (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  34. (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  35. m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  36. })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  37. ga('create', 'UA-36708951-1', 'wenzhixin.net.cn');
  38. ga('send', 'pageview');
  39. </script>
  40. <script type="text/javascript">
  41. if (window!=top) // 判断当前的window对象是否是top对象
  42. top.location.href = window.location.href; // 如果不是,将top对象的网址自动导向被嵌入网页的网址
  43. </script>
  44. <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
  45. <!-- 将此标记放置在 head 中,或放置在结束 body 标记之前,并使其紧邻此标记。 -->
  46. <script src="https://apis.google.com/js/platform.js" async defer></script>
  47. </head>
  48. <body>
  49. <a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
  50. <!-- Docs master nav -->
  51. <header class="navbar navbar-static-top bs-docs-nav" id="top" role="banner">
  52. <div class="container">
  53. <div class="navbar-header">
  54. <button class="navbar-toggle collapsed" type="button" data-toggle="collapse"
  55. data-target=".bs-navbar-collapse">
  56. <span class="sr-only">Toggle navigation</span>
  57. <span class="icon-bar"></span>
  58. <span class="icon-bar"></span>
  59. <span class="icon-bar"></span>
  60. </button>
  61. <a href="../home/" class="navbar-brand">Bootstrap Table</a>
  62. </div>
  63. <nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
  64. <ul class="nav navbar-nav">
  65. <li >
  66. <a href="../getting-started/">Getting started</a>
  67. </li>
  68. <li class="active">
  69. <a href="../documentation/">Documentation</a>
  70. </li>
  71. <li class="dropdown" >
  72. <a href="javascript:" data-toggle="dropdown">
  73. Examples
  74. <span class="caret"></span>
  75. </a>
  76. <ul class="dropdown-menu">
  77. <li><a href="http://issues.wenzhixin.net.cn/bootstrap-table/" target="_blank">Examples</a></li>
  78. <li><a href="https://github.com/wenzhixin/bootstrap-table/issues/1765">jsFiddle Examples</a></li>
  79. </ul>
  80. </li>
  81. <li >
  82. <a href="../extensions/">Extensions</a>
  83. </li>
  84. <li >
  85. <a href="../donate/">Donate</a>
  86. </li>
  87. <li >
  88. <a href="../faq/">FAQ</a>
  89. </li>
  90. <li>
  91. <a href="https://github.com/wenzhixin/bootstrap-table" target="_blank">GitHub</a>
  92. </li>
  93. </ul>
  94. <ul class="nav navbar-nav navbar-right">
  95. <!-- Localization -->
  96. <li>
  97. <a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown">
  98. <span class="language">English</span> <span class="caret"></span>
  99. </a>
  100. <ul class="dropdown-menu">
  101. <li data-language="en">
  102. <a href="javascript:void(0)">
  103. English
  104. </a>
  105. </li>
  106. <li data-language="zh-cn">
  107. <a href="javascript:void(0)">
  108. 简体中文
  109. </a>
  110. </li>
  111. <li data-language="es">
  112. <a href="javascript:void(0)">
  113. Español
  114. </a>
  115. </li>
  116. </ul>
  117. </li>
  118. </ul>
  119. </nav>
  120. </div>
  121. </header>
  122. <!-- Docs page layout -->
  123. <div class="bs-docs-header" id="content">
  124. <div class="container">
  125. <div class="row">
  126. <div class="col-md-8">
  127. <h1>Documentation</h1>
  128. <div>The documentation contains Table Properties, Column Properties, Events, Methods, and much more.</div>
  129. </div>
  130. <div class="col-md-4">
  131. <script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?serve=CK7DE27Y&placement=bootstrap-tablewenzhixinnetcn" id="_carbonads_js"></script>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. <div class="bs-docs-social">
  137. If you like bootstrap table:
  138. <ul class="bs-docs-social-buttons">
  139. <li>
  140. <iframe class="github-btn"
  141. src="http://ghbtns.com/github-btn.html?user=wenzhixin&repo=bootstrap-table&type=watch&count=true"
  142. width="100" height="20" title="Star on GitHub"></iframe>
  143. </li>
  144. <li>
  145. <iframe class="github-btn"
  146. src="http://ghbtns.com/github-btn.html?user=wenzhixin&repo=bootstrap-table&type=fork&count=true"
  147. width="102" height="20" title="Fork on GitHub"></iframe>
  148. </li>
  149. <li>
  150. <iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=wenzhixin&type=follow&count=true"
  151. width="175" height="20" title="Follow on GitHub"></iframe>
  152. </li>
  153. <!--<li>-->
  154. <!-- https://about.twitter.com/resources/buttons#tweet -->
  155. <!--<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://wenzhixin.net.cn/p/bootstrap-table" data-via="BootstrapTable" data-related="BootstrapTable">Tweet</a>-->
  156. <!--</li>-->
  157. <!--<li>-->
  158. <!--将此标记放置在你希望显示+1 按钮的位置。 -->
  159. <!--<div class="g-plusone" data-annotation="inline" data-width="120"></div>-->
  160. <!--</li>-->
  161. <!--<li>-->
  162. <!--<div>QQ group: 103558783</div>-->
  163. <!--</li>-->
  164. </ul>
  165. Questions/Helps:
  166. <ul class="bs-docs-social-buttons">
  167. <li>
  168. <a class="help-btn" href="http://stackoverflow.com/questions/tagged/bootstrap-table">StackOverflow</a>
  169. </li>
  170. <li>
  171. <a class="help-btn" href="http://segmentfault.com/t/bootstrap-table">SegmentFault</a>
  172. </li>
  173. </ul>
  174. </div>
  175. <hr>
  176. <div class="container bs-docs-container">
  177. <div class="row">
  178. <div class="col-md-9"
  179. role="main"
  180. data-toggle="sidenav"
  181. data-container="#sidenav"
  182. data-hs="h1,h2"
  183. data-smart-id="true"
  184. data-bottom=".bs-docs-footer">
  185. <h1>Table options <a href="https://github.com/wenzhixin/bootstrap-table/blob/develop/docs/_i18n/en/documentation/table-options.md"></a></h1>
  186. <p><hr></p>
  187. <p>The table options are defined in <code>jQuery.fn.bootstrapTable.defaults</code>.</p>
  188. <table class="table"
  189. id="t"
  190. data-search="true"
  191. data-show-toggle="true"
  192. data-show-columns="true"
  193. data-mobile-responsive="true">
  194. <thead>
  195. <tr>
  196. <th>Name</th>
  197. <th>Attribute</th>
  198. <th>Type</th>
  199. <th>Default</th>
  200. <th>Description</th>
  201. </tr>
  202. </thead>
  203. <tbody>
  204. <tr>
  205. <td>-</td>
  206. <td>data-toggle</td>
  207. <td>String</td>
  208. <td>'table'</td>
  209. <td>Activate bootstrap table without writing JavaScript.</td>
  210. </tr>
  211. <tr>
  212. <td>classes</td>
  213. <td>data-classes</td>
  214. <td>String</td>
  215. <td>'table table-hover'</td>
  216. <td>The class name of table. By default, the table is bordered, you can add 'table-no-bordered' to remove table-bordered style.</td>
  217. </tr>
  218. <tr>
  219. <td>sortClass</td>
  220. <td>data-sort-class</td>
  221. <td>String</td>
  222. <td>undefined</td>
  223. <td>The class name of the td elements which are sorted.</td>
  224. </tr>
  225. <tr>
  226. <td>height</td>
  227. <td>data-height</td>
  228. <td>Number</td>
  229. <td>undefined</td>
  230. <td>The height of table.</td>
  231. </tr>
  232. <tr>
  233. <td>undefinedText</td>
  234. <td>data-undefined-text</td>
  235. <td>String</td>
  236. <td>'-'</td>
  237. <td>Defines the default undefined text.</td>
  238. </tr>
  239. <tr>
  240. <td>striped</td>
  241. <td>data-striped</td>
  242. <td>Boolean</td>
  243. <td>false</td>
  244. <td>True to stripe the rows.</td>
  245. </tr>
  246. <tr>
  247. <td>sortName</td>
  248. <td>data-sort-name</td>
  249. <td>String</td>
  250. <td>undefined</td>
  251. <td>Defines which column will be sorted.</td>
  252. </tr>
  253. <tr>
  254. <td>sortOrder</td>
  255. <td>data-sort-order</td>
  256. <td>String</td>
  257. <td>'asc'</td>
  258. <td>Defines the column sort order, can only be 'asc' or 'desc'.</td>
  259. </tr>
  260. <tr>
  261. <td>sortStable</td>
  262. <td>data-sort-stable</td>
  263. <td>Boolean</td>
  264. <td>false</td>
  265. <td>True to get a stable sorting. We will add <code>_position</code> property to the row.</td>
  266. </tr>
  267. <tr>
  268. <td>rememberOrder</td>
  269. <td>data-remember-order</td>
  270. <td>Boolean</td>
  271. <td>false</td>
  272. <td>Set <code>true</code> remember the order for each column.</td>
  273. </tr>
  274. <tr>
  275. <td>iconsPrefix</td>
  276. <td>data-icons-prefix</td>
  277. <td>String</td>
  278. <td>'glyphicon'</td>
  279. <td>Defines icon set name ('glyphicon' or 'fa' for FontAwesome). By default 'glyphicon' is used. </td>
  280. </tr>
  281. <tr>
  282. <td>iconSize</td>
  283. <td>data-icon-size</td>
  284. <td>String</td>
  285. <td>undefined</td>
  286. <td>Defines icon size: <ul><li>undefined => btn</li><li>xs => btn-xs</li><li>sm => btn-sm</li><li>lg => btn-lg</li></ul>
  287. </td>
  288. </tr>
  289. <tr>
  290. <td>buttonsClass</td>
  291. <td>data-buttons-class</td>
  292. <td>String</td>
  293. <td>'default'</td>
  294. <td>Defines the Bootstrap class (added after 'btn-') of table buttons: EX: 'primary', 'danger', 'warning'...</td>
  295. </tr>
  296. <tr>
  297. <td>icons</td>
  298. <td>data-icons</td>
  299. <td>Object</td>
  300. <td>{<br/>
  301. &nbsp;&nbsp;<i>paginationSwitchDown:</i> 'glyphicon-collapse-down icon-chevron-down',<br/>
  302. &nbsp;&nbsp;<i>paginationSwitchUp:</i> 'glyphicon-collapse-up icon-chevron-up',<br/>
  303. &nbsp;&nbsp;<i>refresh:</i> 'glyphicon-refresh icon-refresh',<br/>
  304. &nbsp;&nbsp;<i>toggle:</i> 'glyphicon-list-alt icon-list-alt',<br/>
  305. &nbsp;&nbsp;<i>columns:</i> 'glyphicon-th icon-th',<br/>
  306. &nbsp;&nbsp;<i>detailOpen:</i> 'glyphicon-plus icon-plus',<br/>
  307. &nbsp;&nbsp;<i>detailClose:</i> 'glyphicon-minus icon-minus'<br/>
  308. }
  309. </td>
  310. <td>Defines icons used in the toolbar, pagination, and details view.</td>
  311. </tr>
  312. <tr>
  313. <td>columns</td>
  314. <td>-</td>
  315. <td>Array</td>
  316. <td>[]</td>
  317. <td>The table columns config object, see column properties for more details.
  318. </td>
  319. </tr>
  320. <tr>
  321. <td>data</td>
  322. <td>-</td>
  323. <td>Array</td>
  324. <td>[]</td>
  325. <td>The data to be loaded.</td>
  326. </tr>
  327. <tr>
  328. <td>dataField</td>
  329. <td>data-data-field</td>
  330. <td>String</td>
  331. <td>'rows'</td>
  332. <td>Key in incoming json containing rows data list.</td>
  333. </tr>
  334. <tr>
  335. <td>totalField</td>
  336. <td>data-total-field</td>
  337. <td>String</td>
  338. <td>'total'</td>
  339. <td>Key in incoming json containing "total" data .</td>
  340. </tr>
  341. <tr>
  342. <td>ajax</td>
  343. <td>data-ajax</td>
  344. <td>Function</td>
  345. <td>undefined</td>
  346. <td>A method to replace ajax call. Should implement the same API as jQuery ajax method.</td>
  347. </tr>
  348. <tr>
  349. <td>method</td>
  350. <td>data-method</td>
  351. <td>String</td>
  352. <td>'get'</td>
  353. <td>The method type to request remote data.</td>
  354. </tr>
  355. <tr>
  356. <td>url</td>
  357. <td>data-url</td>
  358. <td>String</td>
  359. <td>undefined</td>
  360. <td>
  361. A URL to request data from remote site.
  362. <br/>Note that the required server response format is different depending on whether the 'sidePagination'
  363. option is specified. See the following examples:
  364. <ul>
  365. <li><a href="https://github.com/wenzhixin/bootstrap-table-examples/blob/master/json/data1.json">Without server-side pagination</a></li>
  366. <li><a href="https://github.com/wenzhixin/bootstrap-table-examples/blob/master/json/data2.json">With server-side pagination</a></li>
  367. </ul>
  368. </td>
  369. </tr>
  370. <tr>
  371. <td>cache</td>
  372. <td>data-cache</td>
  373. <td>Boolean</td>
  374. <td>true</td>
  375. <td>False to disable caching of AJAX requests.</td>
  376. </tr>
  377. <tr>
  378. <td>contentType</td>
  379. <td>data-content-type</td>
  380. <td>String</td>
  381. <td>'application/json'</td>
  382. <td>The contentType of request remote data.</td>
  383. </tr>
  384. <tr>
  385. <td>dataType</td>
  386. <td>data-data-type</td>
  387. <td>String</td>
  388. <td>'json'</td>
  389. <td>The type of data that you are expecting back from the server.</td>
  390. </tr>
  391. <tr>
  392. <td>ajaxOptions</td>
  393. <td>data-ajax-options</td>
  394. <td>Object</td>
  395. <td>{}</td>
  396. <td>Additional options for submit ajax request. List of values: <a href="http://api.jquery.com/jQuery.ajax">http://api.jquery.com/jQuery.ajax</a>.</td>
  397. </tr>
  398. <tr>
  399. <td>queryParams</td>
  400. <td>data-query-params</td>
  401. <td>Function</td>
  402. <td>function(params) {<br>return params;<br>}</td>
  403. <td>
  404. When requesting remote data, you can send additional parameters by modifying queryParams.
  405. If queryParamsType = 'limit', the params object contains: <br>
  406. limit, offset, search, sort, order
  407. Else, it contains: <br>
  408. pageSize, pageNumber, searchText, sortName, sortOrder. <br>
  409. Return false to stop request.
  410. </td>
  411. </tr>
  412. <tr>
  413. <td>queryParamsType</td>
  414. <td>data-query-params-type</td>
  415. <td>String</td>
  416. <td>'limit'</td>
  417. <td>Set 'limit' to send query params width RESTFul type.</td>
  418. </tr>
  419. <tr>
  420. <td>responseHandler</td>
  421. <td>data-response-handler</td>
  422. <td>Function</td>
  423. <td>function(res) {<br>return res;<br>}</td>
  424. <td>
  425. Before load remote data, handler the response data format, the parameters object contains: <br>
  426. res: the response data.
  427. </td>
  428. </tr>
  429. <tr>
  430. <td>pagination</td>
  431. <td>data-pagination</td>
  432. <td>Boolean</td>
  433. <td>false</td>
  434. <td>True to show a pagination toolbar on table bottom.</td>
  435. </tr>
  436. <tr>
  437. <td>paginationLoop</td>
  438. <td>data-pagination-loop</td>
  439. <td>Boolean</td>
  440. <td>true</td>
  441. <td>True to enable pagination continuous loop mode.</td>
  442. </tr>
  443. <tr>
  444. <td>onlyInfoPagination</td>
  445. <td>data-only-info-pagination</td>
  446. <td>Boolean</td>
  447. <td>false</td>
  448. <td>True to show only the quantity of the data that is showing in the table. It needs the pagination table options is set to true.</td>
  449. </tr>
  450. <tr>
  451. <td>sidePagination</td>
  452. <td>data-side-pagination</td>
  453. <td>String</td>
  454. <td>'client'</td>
  455. <td>
  456. Defines the side pagination of the table, can only be 'client' or 'server'.
  457. Using 'server' side requires either setting the 'url' or 'ajax' option.
  458. <br/>Note that the required server response format is different depending on whether the 'client' or 'server' option is specified. See the following examples:
  459. <ul>
  460. <li><a href="https://github.com/wenzhixin/bootstrap-table-examples/blob/master/json/data1.json">Without server-side pagination</a></li>
  461. <li><a href="https://github.com/wenzhixin/bootstrap-table-examples/blob/master/json/data2.json">With server-side pagination</a></li>
  462. </ul>
  463. </td>
  464. </tr>
  465. <tr>
  466. <td>pageNumber</td>
  467. <td>data-page-number</td>
  468. <td>Number</td>
  469. <td>1</td>
  470. <td>When set pagination property, initialize the page number.</td>
  471. </tr>
  472. <tr>
  473. <td>pageSize</td>
  474. <td>data-page-size</td>
  475. <td>Number</td>
  476. <td>10</td>
  477. <td>When set pagination property, initialize the page size.</td>
  478. </tr>
  479. <tr>
  480. <td>pageList</td>
  481. <td>data-page-list</td>
  482. <td>Array</td>
  483. <td>[10, 25, 50, 100]</td>
  484. <td>When set pagination property, initialize the page size selecting list. If you include the 'All' or 'Unlimited' option, all the records will be shown in your table.</td>
  485. </tr>
  486. <tr>
  487. <td>selectItemName</td>
  488. <td>data-select-item-name</td>
  489. <td>String</td>
  490. <td>'btSelectItem'</td>
  491. <td>The name of radio or checkbox input.</td>
  492. </tr>
  493. <tr>
  494. <td>smartDisplay</td>
  495. <td>data-smart-display</td>
  496. <td>Boolean</td>
  497. <td>true</td>
  498. <td>True to display pagination or card view smartly.</td>
  499. </tr>
  500. <tr>
  501. <td>escape</td>
  502. <td>data-escape</td>
  503. <td>Boolean</td>
  504. <td>false</td>
  505. <td>Escapes a string for insertion into HTML,
  506. replacing <code>&</code>, <code><</code>, <code>></code>,
  507. <code>"</code>, <code>`</code>, and <code>'</code> characters.</td>
  508. </tr>
  509. <tr>
  510. <td>search</td>
  511. <td>data-search</td>
  512. <td>Boolean</td>
  513. <td>false</td>
  514. <td>Enable the search input.</td>
  515. </tr>
  516. <tr>
  517. <td>searchOnEnterKey</td>
  518. <td>data-search-on-enter-key</td>
  519. <td>Boolean</td>
  520. <td>false</td>
  521. <td>The search method will be executed until the Enter key is pressed.</td>
  522. </tr>
  523. <tr>
  524. <td>strictSearch</td>
  525. <td>data-strict-search</td>
  526. <td>Boolean</td>
  527. <td>false</td>
  528. <td>Enable the strict search.</td>
  529. </tr>
  530. <tr>
  531. <td>searchText</td>
  532. <td>data-search-text</td>
  533. <td>String</td>
  534. <td>''</td>
  535. <td>When set search property, initialize the search text.</td>
  536. </tr>
  537. <tr>
  538. <td>searchTimeOut</td>
  539. <td>data-search-time-out</td>
  540. <td>Number</td>
  541. <td>500</td>
  542. <td>Set timeout for search fire.</td>
  543. </tr>
  544. <tr>
  545. <td>trimOnSearch</td>
  546. <td>data-trim-on-search</td>
  547. <td>Boolean</td>
  548. <td>true</td>
  549. <td>True to trim spaces in search field.</td>
  550. </tr
  551. <tr>
  552. <td>showHeader</td>
  553. <td>data-show-header</td>
  554. <td>Boolean</td>
  555. <td>true</td>
  556. <td>False to hide the table header.</td>
  557. </tr>
  558. <tr>
  559. <td>showFooter</td>
  560. <td>data-show-footer</td>
  561. <td>Boolean</td>
  562. <td>false</td>
  563. <td>True to show the summary footer row.</td>
  564. </tr>
  565. <tr>
  566. <td>showColumns</td>
  567. <td>data-show-columns</td>
  568. <td>Boolean</td>
  569. <td>false</td>
  570. <td>True to show the columns drop down list.</td>
  571. </tr>
  572. <tr>
  573. <td>showRefresh</td>
  574. <td>data-show-refresh</td>
  575. <td>Boolean</td>
  576. <td>false</td>
  577. <td>True to show the refresh button.</td>
  578. </tr>
  579. <tr>
  580. <td>showToggle</td>
  581. <td>data-show-toggle</td>
  582. <td>Boolean</td>
  583. <td>false</td>
  584. <td>True to show the toggle button to toggle table / card view.
  585. </td>
  586. </tr>
  587. <tr>
  588. <td>showPaginationSwitch</td>
  589. <td>data-show-pagination-switch</td>
  590. <td>Boolean</td>
  591. <td>false</td>
  592. <td>True to show the pagination switch button.</td>
  593. </tr>
  594. <tr>
  595. <td>showFullscreen</td>
  596. <td>data-show-fullscreen</td>
  597. <td>Boolean</td>
  598. <td>false</td>
  599. <td>True to show the fullscreen button.</td>
  600. </tr>
  601. <tr>
  602. <td>minimumCountColumns</td>
  603. <td>data-minimum-count-columns</td>
  604. <td>Number</td>
  605. <td>1</td>
  606. <td>The minimum number of columns to hide from the columns drop down list.
  607. </td>
  608. </tr>
  609. <tr>
  610. <td>idField</td>
  611. <td>data-id-field</td>
  612. <td>String</td>
  613. <td>undefined</td>
  614. <td>Indicate which field is an identity field.</td>
  615. </tr>
  616. <tr>
  617. <td>uniqueId</td>
  618. <td>data-unique-id</td>
  619. <td>String</td>
  620. <td>undefined</td>
  621. <td>Indicate an unique identifier for each row.</td>
  622. </tr>
  623. <tr>
  624. <td>cardView</td>
  625. <td>data-card-view</td>
  626. <td>Boolean</td>
  627. <td>false</td>
  628. <td>True to show card view table, for example mobile view.</td>
  629. </tr>
  630. <tr>
  631. <td>detailView</td>
  632. <td>data-detail-view</td>
  633. <td>Boolean</td>
  634. <td>false</td>
  635. <td>True to show detail view table.</td>
  636. </tr>
  637. <tr>
  638. <td>detailFormatter</td>
  639. <td>data-detail-formatter</td>
  640. <td>Function</td>
  641. <td>function(index, row, element) {<br>return '';<br>}</td>
  642. <td>Format your detail view when <code>detailView</code> is set to <code>true</code>. Return a String and it will be appended into the detail view cell, optionally render the element directly using the third parameter which is a jQuery element of the target cell.</td>
  643. </tr>
  644. <tr>
  645. <td>detailFilter</td>
  646. <td>data-detail-filter</td>
  647. <td>Function</td>
  648. <td>function(index, row) {<br>return true;<br>}</td>
  649. <td>Enable expansion per row when <code>detailView</code> is set to <code>true</code>. Return <code>true</code> and the row will be enabled for expansion, return <code>false</code> and expansion for the row will be disabled. Default function returns <code>true</code> to enable expansion for all rows.</td>
  650. </tr>
  651. <tr>
  652. <td>searchAlign</td>
  653. <td>data-search-align</td>
  654. <td>String</td>
  655. <td>'right'</td>
  656. <td>Indicate how to align the search input. 'left', 'right' can be used.</td>
  657. </tr>
  658. <tr>
  659. <td>buttonsAlign</td>
  660. <td>data-buttons-align</td>
  661. <td>String</td>
  662. <td>'right'</td>
  663. <td>Indicate how to align the toolbar buttons. 'left', 'right' can be used.</td>
  664. </tr>
  665. <tr>
  666. <td>toolbarAlign</td>
  667. <td>data-toolbar-align</td>
  668. <td>String</td>
  669. <td>'left'</td>
  670. <td>Indicate how to align the custom toolbar. 'left', 'right' can be used.</td>
  671. </tr>
  672. <tr>
  673. <td>paginationVAlign</td>
  674. <td>data-pagination-v-align</td>
  675. <td>String</td>
  676. <td>'bottom'</td>
  677. <td>Indicate how to align the pagination. 'top', 'bottom', 'both' (put the pagination on top and bottom) can be used.</td>
  678. </tr>
  679. <tr>
  680. <td>paginationHAlign</td>
  681. <td>data-pagination-h-align</td>
  682. <td>String</td>
  683. <td>'right'</td>
  684. <td>Indicate how to align the pagination. 'left', 'right' can be used.</td>
  685. </tr>
  686. <tr>
  687. <td>paginationDetailHAlign</td>
  688. <td>data-pagination-detail-h-align</td>
  689. <td>String</td>
  690. <td>'left'</td>
  691. <td>Indicate how to align the pagination detail. 'left', 'right' can be used.</td>
  692. </tr>
  693. <tr>
  694. <td>paginationPreText</td>
  695. <td>data-pagination-pre-text</td>
  696. <td>String</td>
  697. <td>'&lsaquo;'</td>
  698. <td>Indicate the icon or text to be shown in the pagination detail, the previous button.</td>
  699. </tr>
  700. <tr>
  701. <td>paginationNextText</td>
  702. <td>data-pagination-next-text</td>
  703. <td>String</td>
  704. <td>'&rsaquo;'</td>
  705. <td>Indicate the icon or text to be shown in the pagination detail, the next button.</td>
  706. </tr>
  707. <tr>
  708. <td>clickToSelect</td>
  709. <td>data-click-to-select</td>
  710. <td>Boolean</td>
  711. <td>false</td>
  712. <td>True to select checkbox or radiobox when clicking rows.</td>
  713. </tr>
  714. <tr>
  715. <td>ignoreClickToSelectOn</td>
  716. <td>data-ignore-click-to-select-on</td>
  717. <td>Function</td>
  718. <td><code>{ return $.inArray(element.tagName, ['A', 'BUTTON']); }</code></td>
  719. <td>
  720. Takes one parameters:<br>
  721. element: the element clicked on.<br>
  722. Return true if the click should be ignored, false if the click should cause the row to be selected. This option is only relevant if clickToSelect is true.
  723. </td>
  724. </tr>
  725. <tr>
  726. <td>singleSelect</td>
  727. <td>data-single-select</td>
  728. <td>Boolean</td>
  729. <td>false</td>
  730. <td>True to allow checkbox selecting only one row.</td>
  731. </tr>
  732. <tr>
  733. <td>toolbar</td>
  734. <td>data-toolbar</td>
  735. <td>String | Node</td>
  736. <td>undefined</td>
  737. <td>
  738. A jQuery selector that indicates the toolbar, for example:<br>
  739. #toolbar, .toolbar, or a DOM node.
  740. </td>
  741. </tr>
  742. <tr>
  743. <td>buttonsToolbar</td>
  744. <td>data-buttons-toolbar</td>
  745. <td>String | Node</td>
  746. <td>undefined</td>
  747. <td>
  748. A jQuery selector that indicates the buttons toolbar, for example:<br>
  749. #buttons-toolbar, .buttons-toolbar, or a DOM node.
  750. </td>
  751. </tr>
  752. <tr>
  753. <td>checkboxHeader</td>
  754. <td>data-checkbox-header</td>
  755. <td>Boolean</td>
  756. <td>true</td>
  757. <td>False to hide check-all checkbox in header row.</td>
  758. </tr>
  759. <tr>
  760. <td>maintainSelected</td>
  761. <td>data-maintain-selected</td>
  762. <td>Boolean</td>
  763. <td>false</td>
  764. <td>True to maintain selected rows on change page and search.</td>
  765. </tr>
  766. <tr>
  767. <td>sortable</td>
  768. <td>data-sortable</td>
  769. <td>Boolean</td>
  770. <td>true</td>
  771. <td>False to disable sortable of all columns.</td>
  772. </tr>
  773. <tr>
  774. <td>silentSort</td>
  775. <td>data-silent-sort</td>
  776. <td>Boolean</td>
  777. <td>true</td>
  778. <td>Set <code>false</code> to sort the data silently. This options works when the sidePagination option is set to <code>server</code>.</td>
  779. </tr>
  780. <tr>
  781. <td>rowStyle</td>
  782. <td>data-row-style</td>
  783. <td>Function</td>
  784. <td>{}</td>
  785. <td>
  786. The row style formatter function, takes two parameters: <br>
  787. row: the row record data.<br>
  788. index: the row index.<br>
  789. Support classes or css. Example usage:<br>
  790. <pre>
  791. function rowStyle(row, index) {
  792. return {
  793. classes: 'text-nowrap another-class',
  794. css: {"color": "blue", "font-size": "50px"}
  795. };
  796. }
  797. </pre>
  798. </td>
  799. </tr>
  800. <tr>
  801. <td>rowAttributes</td>
  802. <td>data-row-attributes</td>
  803. <td>Function</td>
  804. <td>{}</td>
  805. <td>
  806. The row attribute formatter function, takes two parameters: <br>
  807. row: the row record data.<br>
  808. index: the row index.<br>
  809. Support all custom attributes.
  810. </td>
  811. </tr>
  812. <tr>
  813. <td>customSearch</td>
  814. <td>data-custom-search</td>
  815. <td>Function</td>
  816. <td>$.noop</td>
  817. <td>
  818. The custom search function is executed instead of built-in search function, takes one parameters: <br>
  819. text: the search text.<br>
  820. Example usage:<br>
  821. <pre>
  822. function customSearch(text) {
  823. //Search logic here.
  824. //You must use `this.data` array in order to filter the data. NO use `this.options.data`.
  825. }
  826. </pre>
  827. </td>
  828. </tr>
  829. <tr>
  830. <td>customSort</td>
  831. <td>data-custom-sort</td>
  832. <td>Function</td>
  833. <td>$.noop</td>
  834. <td>
  835. The custom sort function is executed instead of built-in sort function, takes two parameters: <br>
  836. sortName: the sort name.<br>
  837. sortOrder: the sort order.<br>
  838. Example usage:<br>
  839. <pre>
  840. function customSort(sortName, sortOrder) {
  841. //Sort logic here.
  842. //You must use `this.data` array in order to sort the data. NO use `this.options.data`.
  843. }
  844. </pre>
  845. </td>
  846. </tr>
  847. <tr>
  848. <td>locale</td>
  849. <td>data-locale</td>
  850. <td>String</td>
  851. <td>undefined</td>
  852. <td>
  853. Sets the locale to use (i.e. <code>'fr-CA'</code>). Locale files must be pre-loaded.
  854. Allows for fallback locales, if loaded, in the following order:<br>
  855. <ol>
  856. <li>First tries for the locale as specified,</li>
  857. <li>Then tries the locale with <code>'_'</code> translated to
  858. <code>'-'</code> and the region code upper cased,</li>
  859. <li>Then tries the the short locale code (i.e. <code>'fr'</code> instead of <code>'fr-CA'</code>),</li>
  860. <li>And finally will use the last locale file loaded (or the default locale if no locales loaded).</li>
  861. </ol>
  862. If left undfined or an empty string, uses the last locale loaded (or <code>'en-US'</code>
  863. if no locale files loaded).
  864. </td>
  865. </tr>
  866. <tr>
  867. <td>footerStyle</td>
  868. <td>data-footer-style</td>
  869. <td>Function</td>
  870. <td>{}</td>
  871. <td>
  872. The footer style formatter function, takes two parameters: <br>
  873. row: the row record data.<br>
  874. index: the row index.<br>
  875. Support classes or css. Example usage:<br>
  876. <pre>
  877. function footerStyle(value, row, index) {
  878. return {
  879. css: { "font-weight": "bold" }
  880. };
  881. }
  882. </pre>
  883. </td>
  884. </tr>
  885. </tbody>
  886. </table>
  887. <h1>Column options <a href="https://github.com/wenzhixin/bootstrap-table/blob/develop/docs/_i18n/en/documentation/column-options.md"></a></h1>
  888. <p><hr></p>
  889. <p>The column options is defined in <code>jQuery.fn.bootstrapTable.columnDefaults</code>.</p>
  890. <table class="table"
  891. id="c"
  892. data-search="true"
  893. data-show-toggle="true"
  894. data-show-columns="true"
  895. data-mobile-responsive="true">
  896. <thead>
  897. <tr>
  898. <th>Name</th>
  899. <th>Attribute</th>
  900. <th>Type</th>
  901. <th>Default</th>
  902. <th>Description</th>
  903. </tr>
  904. </thead>
  905. <tbody>
  906. <tr>
  907. <td>radio</td>
  908. <td>data-radio</td>
  909. <td>Boolean</td>
  910. <td>false</td>
  911. <td>True to show a radio. The radio column has fixed width.</td>
  912. </tr>
  913. <tr>
  914. <td>checkbox</td>
  915. <td>data-checkbox</td>
  916. <td>Boolean</td>
  917. <td>false</td>
  918. <td>True to show a checkbox. The checkbox column has fixed width.</td>
  919. </tr>
  920. <tr>
  921. <td>field</td>
  922. <td>data-field</td>
  923. <td>String</td>
  924. <td>undefined</td>
  925. <td>The column field name.</td>
  926. </tr>
  927. <tr>
  928. <td>title</td>
  929. <td>data-title</td>
  930. <td>String</td>
  931. <td>undefined</td>
  932. <td>The column title text.</td>
  933. </tr>
  934. <tr>
  935. <td>titleTooltip</td>
  936. <td>data-title-tooltip</td>
  937. <td>String</td>
  938. <td>undefined</td>
  939. <td>The column title tooltip text. This option also support the title HTML attribute.</td>
  940. </tr>
  941. <tr>
  942. <td>class</td>
  943. <td>class / data-class</td>
  944. <td>String</td>
  945. <td>undefined</td>
  946. <td>The column class name.</td>
  947. </tr>
  948. <tr>
  949. <td>rowspan</td>
  950. <td>rowspan / data-rowspan</td>
  951. <td>Number</td>
  952. <td>undefined</td>
  953. <td>Indicate how many rows a cell should take up.</td>
  954. </tr>
  955. <tr>
  956. <td>colspan</td>
  957. <td>colspan / data-colspan</td>
  958. <td>Number</td>
  959. <td>undefined</td>
  960. <td>Indicate how many columns a cell should take up.</td>
  961. </tr>
  962. <tr>
  963. <td>align</td>
  964. <td>data-align</td>
  965. <td>String</td>
  966. <td>undefined</td>
  967. <td>Indicate how to align the column data. 'left', 'right', 'center' can be used.</td>
  968. </tr>
  969. <tr>
  970. <td>halign</td>
  971. <td>data-halign</td>
  972. <td>String</td>
  973. <td>undefined</td>
  974. <td>Indicate how to align the table header. 'left', 'right', 'center' can be used.</td>
  975. </tr>
  976. <tr>
  977. <td>falign</td>
  978. <td>data-falign</td>
  979. <td>String</td>
  980. <td>undefined</td>
  981. <td>Indicate how to align the table footer. 'left', 'right', 'center' can be used.</td>
  982. </tr>
  983. <tr>
  984. <td>valign</td>
  985. <td>data-valign</td>
  986. <td>String</td>
  987. <td>undefined</td>
  988. <td>Indicate how to align the cell data. 'top', 'middle', 'bottom' can be used.</td>
  989. </tr>
  990. <tr>
  991. <td>width</td>
  992. <td>data-width</td>
  993. <td>Number {Pixels or Percentage}</td>
  994. <td>undefined</td>
  995. <td>The width of column. If not defined, the width will auto expand to fit its contents. Though if the table is left responsive and sized too small this 'width' might be ignored (use min/max-width via class or such then). Also you can add '%' to your number and the bootstrapTable will use the percentage unit, otherwise, leave as number (or add 'px') to make it use pixels.</td>
  996. </tr>
  997. <tr>
  998. <td>sortable</td>
  999. <td>data-sortable</td>
  1000. <td>Boolean</td>
  1001. <td>false</td>
  1002. <td>True to allow the column can be sorted.
  1003. </td>
  1004. </tr>
  1005. <tr>
  1006. <td>order</td>
  1007. <td>data-order</td>
  1008. <td>String</td>
  1009. <td>'asc'</td>
  1010. <td>The default sort order, can only be 'asc' or 'desc'.</td>
  1011. </tr>
  1012. <tr>
  1013. <td>visible</td>
  1014. <td>data-visible</td>
  1015. <td>Boolean</td>
  1016. <td>true</td>
  1017. <td>False to hide the columns item.</td>
  1018. </tr>
  1019. <tr>
  1020. <td>cardVisible</td>
  1021. <td>data-card-visible</td>
  1022. <td>Boolean</td>
  1023. <td>true</td>
  1024. <td>False to hide the columns item in card view state.</td>
  1025. </tr>
  1026. <tr>
  1027. <td>switchable</td>
  1028. <td>data-switchable</td>
  1029. <td>Boolean</td>
  1030. <td>true</td>
  1031. <td>False to disable the switchable of columns item.</td>
  1032. </tr>
  1033. <tr>
  1034. <td>clickToSelect</td>
  1035. <td>data-click-to-select</td>
  1036. <td>Boolean</td>
  1037. <td>true</td>
  1038. <td>True to select checkbox or radio when the column is clicked.</td>
  1039. </tr>
  1040. <tr>
  1041. <td>formatter</td>
  1042. <td>data-formatter</td>
  1043. <td>Function</td>
  1044. <td>undefined</td>
  1045. <td>
  1046. The context (this) is the column Object. <br>
  1047. The cell formatter function, take three parameters: <br>
  1048. value: the field value. <br>
  1049. row: the row record data.<br>
  1050. index: the row index.<br>
  1051. field: the row field.<br>
  1052. Example usage:<br>
  1053. <pre>
  1054. function formatter(value, row, index, field) {
  1055. if (value === 'foo') {
  1056. return '<strong>' + value + '</strong>';
  1057. }
  1058. return value;
  1059. }
  1060. </pre>
  1061. </td>
  1062. </tr>
  1063. <tr>
  1064. <td>footerFormatter</td>
  1065. <td>data-footer-formatter</td>
  1066. <td>Function</td>
  1067. <td>undefined</td>
  1068. <td>
  1069. The context (this) is the column Object. <br>
  1070. The function, take one parameter: <br>
  1071. data: Array of all the data rows. <br>
  1072. the function should return a string with the text to show in the footer cell.
  1073. </tr>
  1074. <tr>
  1075. <td>events</td>
  1076. <td>data-events</td>
  1077. <td>Object</td>
  1078. <td>undefined</td>
  1079. <td>
  1080. The cell events listener when you use formatter function, take four parameters: <br>
  1081. event: the jQuery event. <br>
  1082. value: the field value. <br>
  1083. row: the row record data.<br>
  1084. index: the row index. <br>
  1085. Example code:
  1086. <code>&lt;th .. data-events="operateEvent"&gt;</code>
  1087. <code>var operateEvents = {'click .like': function (e, value, row, index) {}};</code>
  1088. </td>
  1089. </tr>
  1090. <tr>
  1091. <td>sorter</td>
  1092. <td>data-sorter</td>
  1093. <td>Function</td>
  1094. <td>undefined</td>
  1095. <td>
  1096. The custom field sort function that used to do local sorting, take two parameters: <br>
  1097. a: the first field value.<br>
  1098. b: the second field value.<br>
  1099. rowA: the first row.<br>
  1100. rowB: the second row.
  1101. </td>
  1102. </tr>
  1103. <tr>
  1104. <td>sortName</td>
  1105. <td>data-sort-name</td>
  1106. <td>String</td>
  1107. <td>undefined</td>
  1108. <td>Provide a customizable sort-name, not the default sort-name in the header, or the field name
  1109. of the column. For example, a column might display the value of fieldName of "html" such as
  1110. "&lt;b&gt;&lt;span style="color:red"&gt;abc&lt;/span&gt;&lt;/b&gt;", but a fieldName to sort is "content" with the value of "abc".
  1111. </td>
  1112. </tr>
  1113. <tr>
  1114. <td>cellStyle</td>
  1115. <td>data-cell-style</td>
  1116. <td>Function</td>
  1117. <td>undefined</td>
  1118. <td>
  1119. The cell style formatter function, take three parameters: <br>
  1120. value: the field value.<br>
  1121. row: the row record data.<br>
  1122. index: the row index.<br>
  1123. field: the row field.<br>
  1124. Support classes or css. Example usage:<br>
  1125. <pre>
  1126. function cellStyle(value, row, index, field) {
  1127. return {
  1128. classes: 'text-nowrap another-class',
  1129. css: {"color": "blue", "font-size": "50px"}
  1130. };
  1131. }
  1132. </pre>
  1133. </td>
  1134. </tr>
  1135. <tr>
  1136. <td>searchable</td>
  1137. <td>data-searchable</td>
  1138. <td>Boolean</td>
  1139. <td>true</td>
  1140. <td>
  1141. True to search data for this column.
  1142. </td>
  1143. </tr>
  1144. <tr>
  1145. <td>searchFormatter</td>
  1146. <td>data-search-formatter</td>
  1147. <td>Boolean</td>
  1148. <td>true</td>
  1149. <td>
  1150. True to search use formatted data.
  1151. </td>
  1152. </tr>
  1153. <tr>
  1154. <td>escape</td>
  1155. <td>data-escape</td>
  1156. <td>Boolean</td>
  1157. <td>false</td>
  1158. <td>
  1159. Escapes a string for insertion into HTML, replacing &, <, >, ", \`, and ' characters.
  1160. </td>
  1161. </tr>
  1162. <tr>
  1163. <td>showSelectTitle</td>
  1164. <td>data-show-select-title</td>
  1165. <td>Boolean</td>
  1166. <td>false</td>
  1167. <td>
  1168. True to show the title of column with 'radio' or 'singleSelect' 'checkbox' option.
  1169. </td>
  1170. </tr>
  1171. </tbody>
  1172. </table>
  1173. <h1>Events <a href="https://github.com/wenzhixin/bootstrap-table/blob/develop/docs/_i18n/en/documentation/events.md"></a></h1>
  1174. <p><hr></p>
  1175. <p>To use event syntax:</p>
  1176. <div class="highlight"><pre><code class="language-js" data-lang="js"><span class="nx">$</span><span class="p">(</span><span class="s1">'#table'</span><span class="p">).</span><span class="nx">bootstrapTable</span><span class="p">({</span>
  1177. <span class="na">onEventName</span><span class="p">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">arg1</span><span class="p">,</span> <span class="nx">arg2</span><span class="p">,</span> <span class="p">...)</span> <span class="p">{</span>
  1178. <span class="c1">// ...</span>
  1179. <span class="p">}</span>
  1180. <span class="p">});</span>
  1181. <span class="nx">$</span><span class="p">(</span><span class="s1">'#table'</span><span class="p">).</span><span class="nx">on</span><span class="p">(</span><span class="s1">'event-name.bs.table'</span><span class="p">,</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">arg1</span><span class="p">,</span> <span class="nx">arg2</span><span class="p">,</span> <span class="p">...)</span> <span class="p">{</span>
  1182. <span class="c1">// ...</span>
  1183. <span class="p">});</span>
  1184. </code></pre></div>
  1185. <table class="table"
  1186. id="e"
  1187. data-search="true"
  1188. data-show-toggle="true"
  1189. data-show-columns="true"
  1190. data-mobile-responsive="true">
  1191. <thead>
  1192. <tr>
  1193. <th>Option Event</th>
  1194. <th>jQuery Event</th>
  1195. <th>Parameter</th>
  1196. <th>Description</th>
  1197. </tr>
  1198. </thead>
  1199. <tbody>
  1200. <tr>
  1201. <td>onAll</td>
  1202. <td>all.bs.table</td>
  1203. <td>name, args</td>
  1204. <td>
  1205. Fires when all events trigger, the parameters contain: <br>
  1206. name: the event name, <br>
  1207. args: the event data.
  1208. </td>
  1209. </tr>
  1210. <tr>
  1211. <td>onClickRow</td>
  1212. <td>click-row.bs.table</td>
  1213. <td>row, $element, field</td>
  1214. <td>
  1215. Fires when user click a row, the parameters contain: <br>
  1216. row: the record corresponding to the clicked row, <br>
  1217. $element: the tr element, <br>
  1218. field: the field name corresponding to the clicked cell.
  1219. </td>
  1220. </tr>
  1221. <tr>
  1222. <td>onDblClickRow</td>
  1223. <td>dbl-click-row.bs.table</td>
  1224. <td>row, $element, field</td>
  1225. <td>
  1226. Fires when user double click a row, the parameters contain: <br>
  1227. row: the record corresponding to the clicked row, <br>
  1228. $element: the tr element, <br>
  1229. field: the field name corresponding to the clicked cell.
  1230. </td>
  1231. </tr>
  1232. <tr>
  1233. <td>onClickCell</td>
  1234. <td>click-cell.bs.table</td>
  1235. <td>field, value, row, $element</td>
  1236. <td>
  1237. Fires when user click a cell, the parameters contain: <br>
  1238. field: the field name corresponding to the clicked cell, <br>
  1239. value: the data value corresponding to the clicked cell, <br>
  1240. row: the record corresponding to the clicked row, <br>
  1241. $element: the td element.
  1242. </td>
  1243. </tr>
  1244. <tr>
  1245. <td>onDblClickCell</td>
  1246. <td>dbl-click-cell.bs.table</td>
  1247. <td>field, value, row, $element</td>
  1248. <td>
  1249. Fires when user double click a cell, the parameters contain: <br>
  1250. field: the field name corresponding to the clicked cell, <br>
  1251. value: the data value corresponding to the clicked cell, <br>
  1252. row: the record corresponding to the clicked row, <br>
  1253. $element: the td element.
  1254. </td>
  1255. </tr>
  1256. <tr>
  1257. <td>onSort</td>
  1258. <td>sort.bs.table</td>
  1259. <td>name, order</td>
  1260. <td>
  1261. Fires when user sort a column, the parameters contain: <br>
  1262. name: the sort column field name<br>
  1263. order: the sort column order.
  1264. </td>
  1265. </tr>
  1266. <tr>
  1267. <td>onCheck</td>
  1268. <td>check.bs.table</td>
  1269. <td>row, $element</td>
  1270. <td>
  1271. Fires when user check a row, the parameters contain: <br>
  1272. row: the record corresponding to the clicked row.
  1273. $element: the DOM element checked.
  1274. </td>
  1275. </tr>
  1276. <tr>
  1277. <td>onUncheck</td>
  1278. <td>uncheck.bs.table</td>
  1279. <td>row, $element</td>
  1280. <td>
  1281. Fires when user uncheck a row, the parameters contain: <br>
  1282. row: the record corresponding to the clicked row.
  1283. $element: the DOM element unchecked.
  1284. </td>
  1285. </tr>
  1286. <tr>
  1287. <td>onCheckAll</td>
  1288. <td>check-all.bs.table</td>
  1289. <td>rows</td>
  1290. <td>
  1291. Fires when user check all rows, the parameters contain: <br>
  1292. rows: array of records corresponding to newly checked rows.
  1293. </td>
  1294. </tr>
  1295. <tr>
  1296. <td>onUncheckAll</td>
  1297. <td>uncheck-all.bs.table</td>
  1298. <td>rows</td>
  1299. <td>
  1300. Fires when user uncheck all rows, the parameters contain: <br>
  1301. rows: array of records corresponding to previously checked rows.
  1302. </td>
  1303. </tr>
  1304. <tr>
  1305. <td>onCheckSome</td>
  1306. <td>check-some.bs.table</td>
  1307. <td>rows</td>
  1308. <td>
  1309. Fires when user check some rows, the parameters contain: <br>
  1310. rows: array of records corresponding to newly checked rows.
  1311. </td>
  1312. </tr>
  1313. <tr>
  1314. <td>onUncheckSome</td>
  1315. <td>uncheck-some.bs.table</td>
  1316. <td>rows</td>
  1317. <td>
  1318. Fires when user uncheck some rows, the parameters contain: <br>
  1319. rows: array of records corresponding to previously checked rows.
  1320. </td>
  1321. </tr>
  1322. <tr>
  1323. <td>onLoadSuccess</td>
  1324. <td>load-success.bs.table</td>
  1325. <td>data</td>
  1326. <td>Fires when remote data is loaded
  1327. successfully.
  1328. </td>
  1329. </tr>
  1330. <tr>
  1331. <td>onLoadError</td>
  1332. <td>load-error.bs.table</td>
  1333. <td>status, res</td>
  1334. <td>Fires when some errors occur to load remote data.</td>
  1335. </tr>
  1336. <tr>
  1337. <td>onColumnSwitch</td>
  1338. <td>column-switch.bs.table</td>
  1339. <td>field, checked</td>
  1340. <td>Fires when switch the column visible.</td>
  1341. </tr>
  1342. <tr>
  1343. <td>onColumnSearch</td>
  1344. <td>column-search.bs.table</td>
  1345. <td>field, text</td>
  1346. <td>Fires when search by column.</td>
  1347. </tr>
  1348. <tr>
  1349. <td>onPageChange</td>
  1350. <td>page-change.bs.table</td>
  1351. <td>number, size</td>
  1352. <td>Fires when change the page number or page size.</td>
  1353. </tr>
  1354. <tr>
  1355. <td>onSearch</td>
  1356. <td>search.bs.table</td>
  1357. <td>text</td>
  1358. <td>Fires when search the table.</td>
  1359. </tr>
  1360. <tr>
  1361. <td>onToggle</td>
  1362. <td>toggle.bs.table</td>
  1363. <td>cardView</td>
  1364. <td>Fires when toggle the view of table.</td>
  1365. </tr>
  1366. <tr>
  1367. <td>onPreBody</td>
  1368. <td>pre-body.bs.table</td>
  1369. <td>data</td>
  1370. <td>Fires before the table body is rendered</td>
  1371. </tr>
  1372. <tr>
  1373. <td>onPostBody</td>
  1374. <td>post-body.bs.table</td>
  1375. <td>data</td>
  1376. <td>Fires after the table body is rendered and available in the DOM</td>
  1377. </tr>
  1378. <tr>
  1379. <td>onPostHeader</td>
  1380. <td>post-header.bs.table</td>
  1381. <td>none</td>
  1382. <td>Fires after the table header is rendered and availble in the DOM</td>
  1383. </tr>
  1384. <tr>
  1385. <td>onExpandRow</td>
  1386. <td>expand-row.bs.table</td>
  1387. <td>index, row, $detail</td>
  1388. <td>Fires when click the detail icon to expand the detail view.</td>
  1389. </tr>
  1390. <tr>
  1391. <td>onCollapseRow</td>
  1392. <td>collapse-row.bs.table</td>
  1393. <td>index, row</td>
  1394. <td>Fires when click the detail icon to collapse the detail view.</td>
  1395. </tr>
  1396. <tr>
  1397. <td>onRefreshOptions</td>
  1398. <td>refresh-options.bs.table</td>
  1399. <td>options</td>
  1400. <td>Fires after refresh the options and before destroy and init the table</td>
  1401. </tr>
  1402. <tr>
  1403. <td>onResetView</td>
  1404. <td>reset-view.bs.table</td>
  1405. <td></td>
  1406. <td>Fires when reset view of the table.</td>
  1407. </tr>
  1408. <tr>
  1409. <td>onRefresh</td>
  1410. <td>refresh.bs.table</td>
  1411. <td>params</td>
  1412. <td>Fires after the click the refresh button.</td>
  1413. </tr>
  1414. <tr>
  1415. <td>onScrollBody</td>
  1416. <td>scroll-body.bs.table</td>
  1417. <td></td>
  1418. <td>Fires when table body scroll.</td>
  1419. </tr>
  1420. </tbody>
  1421. </table>
  1422. <h1>Methods <a href="https://github.com/wenzhixin/bootstrap-table/blob/develop/docs/_i18n/en/documentation/methods.md"></a></h1>
  1423. <p><hr></p>
  1424. <p>The calling method syntax: <code>$(&#39;#table&#39;).bootstrapTable(&#39;method&#39;, parameter);</code>.</p>
  1425. <table class="table"
  1426. id="m"
  1427. data-search="true"
  1428. data-show-toggle="true"
  1429. data-show-columns="true"
  1430. data-mobile-responsive="true">
  1431. <thead>
  1432. <tr>
  1433. <th>Name</th>
  1434. <th>Parameter</th>
  1435. <th>Description</th>
  1436. <th data-formatter="methodFormatter"
  1437. data-align="center"
  1438. data-valign="middle">Example</th>
  1439. </tr>
  1440. </thead>
  1441. <tbody>
  1442. <tr>
  1443. <td>getOptions</td>
  1444. <td>none</td>
  1445. <td>Return the options object.</td>
  1446. <td>getOptions</td>
  1447. </tr>
  1448. <tr>
  1449. <td>getSelections</td>
  1450. <td>none</td>
  1451. <td>Return selected rows, when no record selected, an empty array will return.</td>
  1452. <td>getSelections</td>
  1453. </tr>
  1454. <tr>
  1455. <td>getAllSelections</td>
  1456. <td>none</td>
  1457. <td>Return all selected rows contain search or filter, when no record selected, an empty array will return.</td>
  1458. <td>getAllSelections</td>
  1459. </tr>
  1460. <tr>
  1461. <td>showAllColumns</td>
  1462. <td>none</td>
  1463. <td>Show All the columns.</td>
  1464. <td>showAllColumns</td>
  1465. </tr>
  1466. <tr>
  1467. <td>hideAllColumns</td>
  1468. <td>none</td>
  1469. <td>Hide All the columns.</td>
  1470. <td>hidAllColumns</td>
  1471. </tr>
  1472. <tr>
  1473. <td>getData</td>
  1474. <td>useCurrentPage</td>
  1475. <td>Get the loaded data of table at the moment that this method is called. If you set the useCurrentPage to true the method will return the data in the current page.</td>
  1476. <td>getData</td>
  1477. </tr>
  1478. <tr>
  1479. <td>getRowByUniqueId</td>
  1480. <td>id</td>
  1481. <td>Get data from table, the row that contains the id passed by parameter.</td>
  1482. <td>getRowByUniqueId</td>
  1483. </tr>
  1484. <tr>
  1485. <td>load</td>
  1486. <td>data</td>
  1487. <td>Load the data to table, the old rows will be removed.</td>
  1488. <td>load</td>
  1489. </tr>
  1490. <tr>
  1491. <td>append</td>
  1492. <td>data</td>
  1493. <td>Append the data to table.</td>
  1494. <td>append</td>
  1495. </tr>
  1496. <tr>
  1497. <td>prepend</td>
  1498. <td>data</td>
  1499. <td>Prepend the data to table.</td>
  1500. <td>prepend</td>
  1501. </tr>
  1502. <tr>
  1503. <td>remove</td>
  1504. <td>params</td>
  1505. <td>
  1506. Remove data from table, the params contains two properties: <br>
  1507. field: the field name of remove rows. <br>
  1508. values: the array of values for rows which should be removed.
  1509. </td>
  1510. <td>remove</td>
  1511. </tr>
  1512. <tr>
  1513. <td>removeAll</td>
  1514. <td>-</td>
  1515. <td>
  1516. Remove all data from table.
  1517. </td>
  1518. <td>removeAll</td>
  1519. </tr>
  1520. <tr>
  1521. <td>removeByUniqueId</td>
  1522. <td>id</td>
  1523. <td>
  1524. Remove data from table, the row that contains the id passed by parameter.
  1525. </td>
  1526. <td>removeByUniqueId</td>
  1527. </tr>
  1528. <tr>
  1529. <td>insertRow</td>
  1530. <td>params</td>
  1531. <td>
  1532. Insert a new row, the param contains following properties:<br>
  1533. index: the row index to insert into.<br>
  1534. row: the row data.
  1535. </td>
  1536. </tr>
  1537. <tr>
  1538. <td>updateRow</td>
  1539. <td>params</td>
  1540. <td>
  1541. Update the specified row(s), each param contains following properties: <br>
  1542. index: the row index to be updated. <br>
  1543. row: the new row data.
  1544. </td>
  1545. </tr>
  1546. <tr>
  1547. <td>updateByUniqueId</td>
  1548. <td>params</td>
  1549. <td>
  1550. Update the specified row(s), each param contains following properties: <br>
  1551. id: a row id where the id should be the uniqueid field assigned to the table. <br>
  1552. row: the new row data.
  1553. </td>
  1554. </tr>
  1555. <tr>
  1556. <td>showRow</td>
  1557. <td>params</td>
  1558. <td>Show the specified row. The param must contain at least one of the following properties:
  1559. index: the row index.
  1560. uniqueId: the value of the uniqueId for that row.</td>
  1561. </tr>
  1562. <tr>
  1563. <td>hideRow</td>
  1564. <td>params</td>
  1565. <td>Hide the specified row. The param must contain at least one of the following properties:
  1566. index: the row index.
  1567. uniqueId: the value of the uniqueId for that row.</td>
  1568. </tr>
  1569. <tr>
  1570. <td>getHiddenRows</td>
  1571. <td>boolean</td>
  1572. <td>Get all rows hidden and if you pass the show parameter true the rows will be shown again, otherwise, the method
  1573. only will return the rows hidden.</td>
  1574. </tr>
  1575. <tr>
  1576. <td>mergeCells</td>
  1577. <td>options</td>
  1578. <td>
  1579. Merge some cells to one cell, the options contains following properties: <br>
  1580. index: the row index. <br>
  1581. field: the field name.<br>
  1582. rowspan: the rowspan count to be merged. <br>
  1583. colspan: the colspan count to be merged.
  1584. </td>
  1585. </tr>
  1586. <tr>
  1587. <td>updateCell</td>
  1588. <td>params</td>
  1589. <td>
  1590. Update one cell, the params contains following properties: <br>
  1591. index: the row index. <br>
  1592. field: the field name.<br>
  1593. value: the new field value.
  1594. <br>
  1595. To disable table re-initialization you can set <code>{reinit: false}</code>
  1596. </td>
  1597. </tr>
  1598. <tr>
  1599. <td>refresh</td>
  1600. <td>params</td>
  1601. <td>Refresh the remote server data, you can set <code>{silent: true}</code> to refresh the data silently, and set <code>{url: newUrl, pageNumber: pageNumber, pageSize: pageSize}</code> to change the url (optional), page number (optional) and page size (optional). To supply query params specific to this request, set <code>{query: {foo: 'bar'}}</code>.</td>
  1602. </tr>
  1603. <tr>
  1604. <td>refreshOptions</td>
  1605. <td>options</td>
  1606. <td>Refresh the options</td>
  1607. </tr>
  1608. <tr>
  1609. <td>resetSearch</td>
  1610. <td>text</td>
  1611. <td>Set the search text</td>
  1612. </tr>
  1613. <tr>
  1614. <td>showLoading</td>
  1615. <td>none</td>
  1616. <td>Show loading status.</td>
  1617. </tr>
  1618. <tr>
  1619. <td>hideLoading</td>
  1620. <td>none</td>
  1621. <td>Hide loading status.</td>
  1622. </tr>
  1623. <tr>
  1624. <td>checkAll</td>
  1625. <td>none</td>
  1626. <td>Check all current page rows.</td>
  1627. </tr>
  1628. <tr>
  1629. <td>uncheckAll</td>
  1630. <td>none</td>
  1631. <td>Uncheck all current page rows.</td>
  1632. </tr>
  1633. <tr>
  1634. <td>checkInvert</td>
  1635. <td>none</td>
  1636. <td>Invert check of current page rows. Triggers onCheckSome and onUncheckSome events.</td>
  1637. </tr>
  1638. <tr>
  1639. <td>check</td>
  1640. <td>index</td>
  1641. <td>Check a row, the row index start with 0.</td>
  1642. </tr>
  1643. <tr>
  1644. <td>uncheck</td>
  1645. <td>index</td>
  1646. <td>Uncheck a row, the row index start with 0.</td>
  1647. </tr>
  1648. <tr>
  1649. <td>checkBy</td>
  1650. <td>params</td>
  1651. <td>
  1652. Check a row by array of values, the params contains:<br>
  1653. field: name of the field used to find records<br>
  1654. values: array of values for rows to check<br>
  1655. Example: <br>
  1656. $("#table").bootstrapTable("checkBy", {field:"field_name", values:["value1","value2","value3"]})
  1657. </td>
  1658. </tr>
  1659. <tr>
  1660. <td>uncheckBy</td>
  1661. <td>params</td>
  1662. <td>
  1663. Uncheck a row by array of values, the params contains:<br>
  1664. field: name of the field used to find records<br>
  1665. values: array of values for rows to uncheck<br>
  1666. Example: <br>
  1667. $("#table").bootstrapTable("uncheckBy", {field:"field_name", values:["value1","value2","value3"]})
  1668. </td>
  1669. </tr>
  1670. <tr>
  1671. <td>resetView</td>
  1672. <td>params</td>
  1673. <td>Reset the bootstrap table view, for example reset the table height.</td>
  1674. </tr>
  1675. <tr>
  1676. <td>resetWidth</td>
  1677. <td>none</td>
  1678. <td>Resizes header and footer to fit current columns width</td>
  1679. </tr>
  1680. <tr>
  1681. <td>destroy</td>
  1682. <td>none</td>
  1683. <td>Destroy the bootstrap table.</td>
  1684. </tr>
  1685. <tr>
  1686. <td>showColumn</td>
  1687. <td>field</td>
  1688. <td>Show the specified column.</td>
  1689. </tr>
  1690. <tr>
  1691. <td>hideColumn</td>
  1692. <td>field</td>
  1693. <td>Hide the specified column.</td>
  1694. </tr>
  1695. <tr>
  1696. <td>getHiddenColumns</td>
  1697. <td>-</td>
  1698. <td>Get hidden columns.</td>
  1699. </tr>
  1700. <tr>
  1701. <td>getVisibleColumns</td>
  1702. <td>-</td>
  1703. <td>Get visible columns.</td>
  1704. </tr>
  1705. <tr>
  1706. <td>scrollTo</td>
  1707. <td>value</td>
  1708. <td>Scroll to the number value position, the unit is 'px', set 'bottom' means scroll to the bottom.</td>
  1709. </tr>
  1710. <tr>
  1711. <td>getScrollPosition</td>
  1712. <td>none</td>
  1713. <td>Get the current scroll position, the unit is 'px'.</td>
  1714. </tr>
  1715. <tr>
  1716. <td>filterBy</td>
  1717. <td>params</td>
  1718. <td>(Can use only in client-side) Filter data in table, e.g. you can filter <code>{age: 10}</code> to show the data only age is equal to 10. You can also filter with an array of values, as in: <code>{age: 10, hairColor: ["blue", "red", "green"]} to find data where age is equal to 10 and hairColor is either blue, red, or green.</td>
  1719. </tr>
  1720. <tr>
  1721. <td>selectPage</td>
  1722. <td>page</td>
  1723. <td>Go to the a specified page.</td>
  1724. </tr>
  1725. <tr>
  1726. <td>prevPage</td>
  1727. <td>none</td>
  1728. <td>Go to previous page.</td>
  1729. </tr>
  1730. <tr>
  1731. <td>nextPage</td>
  1732. <td>none</td>
  1733. <td>Go to next page.</td>
  1734. </tr>
  1735. <tr>
  1736. <td>togglePagination</td>
  1737. <td>none</td>
  1738. <td>Toggle the pagination option.</td>
  1739. </tr>
  1740. <tr>
  1741. <td>toggleView</td>
  1742. <td>none</td>
  1743. <td>Toggle the card/table view.</td>
  1744. </tr>
  1745. <tr>
  1746. <td>expandRow</td>
  1747. <td>index</td>
  1748. <td>Expand the row that has the index passed by parameter if the detail view option is set to True.</td>
  1749. </tr>
  1750. <tr>
  1751. <td>collapseRow</td>
  1752. <td>index</td>
  1753. <td>Collapse the row that has the index passed by parameter if the detail view option is set to True.</td>
  1754. </tr>
  1755. <tr>
  1756. <td>expandAllRows</td>
  1757. <td>is subtable</td>
  1758. <td>Expand all rows if the detail view option is set to True.</td>
  1759. </tr>
  1760. <tr>
  1761. <td>collapseAllRows</td>
  1762. <td>is subtable</td>
  1763. <td>Collapse all rows if the detail view option is set to True.</td>
  1764. </tr>
  1765. <tr>
  1766. <td>updateCellById</td>
  1767. <td>params</td>
  1768. <td>
  1769. update the cell specified by the id, each param contains following properties: <br>
  1770. id: row id where the id should be the uniqueid field assigned to the table. <br>
  1771. field: field name of the cell to be updated.<br>
  1772. value: new value of the cell.
  1773. </td>
  1774. </tr>
  1775. </tbody>
  1776. </table>
  1777. <h1>Localizations <a href="https://github.com/wenzhixin/bootstrap-table/blob/develop/docs/_i18n/en/documentation/localizations.md"></a></h1>
  1778. <p><hr></p>
  1779. <table class="table"
  1780. id="l"
  1781. data-search="true"
  1782. data-show-toggle="true"
  1783. data-show-columns="true"
  1784. data-mobile-responsive="true">
  1785. <thead>
  1786. <tr>
  1787. <th>Name</th>
  1788. <th>Parameter</th>
  1789. <th>Default</th>
  1790. </tr>
  1791. </thead>
  1792. <tbody>
  1793. <tr>
  1794. <td>formatLoadingMessage</td>
  1795. <td>-</td>
  1796. <td>'Loading, please wait…'</td>
  1797. </tr>
  1798. <tr>
  1799. <td>formatRecordsPerPage</td>
  1800. <td>pageNumber</td>
  1801. <td>'%s records per page'</td>
  1802. </tr>
  1803. <tr>
  1804. <td>formatShowingRows</td>
  1805. <td>pageFrom, pageTo, totalRows</td>
  1806. <td>'Showing %s to %s of %s rows'</td>
  1807. </tr>
  1808. <tr>
  1809. <td>formatDetailPagination</td>
  1810. <td>totalRows</td>
  1811. <td>'Showing %s rows'</td>
  1812. </tr>
  1813. <tr>
  1814. <td>formatSearch</td>
  1815. <td>-</td>
  1816. <td>'Search'</td>
  1817. </tr>
  1818. <tr>
  1819. <td>formatNoMatches</td>
  1820. <td>-</td>
  1821. <td>'No matching records found'</td>
  1822. </tr>
  1823. <tr>
  1824. <td>formatRefresh</td>
  1825. <td>-</td>
  1826. <td>'Refresh'</td>
  1827. </tr>
  1828. <tr>
  1829. <td>formatToggle</td>
  1830. <td>-</td>
  1831. <td>'Toggle'</td>
  1832. </tr>
  1833. <tr>
  1834. <td>formatColumns</td>
  1835. <td>-</td>
  1836. <td>'Columns'</td>
  1837. </tr>
  1838. <tr>
  1839. <td>formatAllRows</td>
  1840. <td>-</td>
  1841. <td>'All'</td>
  1842. </tr>
  1843. <tr>
  1844. <td>formatFullscreen</td>
  1845. <td>-</td>
  1846. <td>'Fullscreen'</td>
  1847. </tr>
  1848. </tbody>
  1849. </table>
  1850. <p><hr></p>
  1851. <p><strong>PS:</strong></p>
  1852. <p>We can import <a href="https://github.com/wenzhixin/bootstrap-table/tree/master/src/locale">all locale files</a> what you need:</p>
  1853. <div class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt">&lt;script </span><span class="na">src=</span><span class="s">"bootstrap-table-en-US.js"</span><span class="nt">&gt;&lt;/script&gt;</span>
  1854. <span class="nt">&lt;script </span><span class="na">src=</span><span class="s">"bootstrap-table-zh-CN.js"</span><span class="nt">&gt;&lt;/script&gt;</span>
  1855. ...
  1856. </code></pre></div>
  1857. <p>And then use JavaScript to switch locale:</p>
  1858. <div class="highlight"><pre><code class="language-js" data-lang="js"><span class="nx">$</span><span class="p">.</span><span class="nx">extend</span><span class="p">(</span><span class="nx">$</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">bootstrapTable</span><span class="p">.</span><span class="nx">defaults</span><span class="p">,</span> <span class="nx">$</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">bootstrapTable</span><span class="p">.</span><span class="nx">locales</span><span class="p">[</span><span class="s1">'en-US'</span><span class="p">]);</span>
  1859. <span class="c1">// $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['zh-CN']);</span>
  1860. <span class="c1">// ...</span>
  1861. </code></pre></div>
  1862. <p>Or use data attributes to set locale for table:</p>
  1863. <div class="highlight"><pre><code class="language-html" data-lang="html"><span class="nt">&lt;table</span> <span class="na">data-toggle=</span><span class="s">"table"</span> <span class="na">data-locale=</span><span class="s">"en-US"</span><span class="nt">&gt;</span>
  1864. <span class="nt">&lt;/table&gt;</span>
  1865. </code></pre></div>
  1866. <p>Or use JavaScript to set locale for table:</p>
  1867. <div class="highlight"><pre><code class="language-js" data-lang="js"><span class="nx">$</span><span class="p">(</span><span class="s1">'table'</span><span class="p">).</span><span class="nx">bootstrapTable</span><span class="p">({</span><span class="na">locale</span><span class="p">:</span><span class="s1">'en-US'</span><span class="p">});</span>
  1868. </code></pre></div>
  1869. </div>
  1870. <div class="col-md-3">
  1871. <div id="sidenav"></div>
  1872. </div>
  1873. </div>
  1874. </div>
  1875. <!-- Footer
  1876. ================================================== -->
  1877. <footer class="bs-docs-footer" role="contentinfo">
  1878. <div class="container">
  1879. <div class="bs-docs-social">
  1880. If you like bootstrap table:
  1881. <ul class="bs-docs-social-buttons">
  1882. <li>
  1883. <iframe class="github-btn"
  1884. src="http://ghbtns.com/github-btn.html?user=wenzhixin&repo=bootstrap-table&type=watch&count=true"
  1885. width="100" height="20" title="Star on GitHub"></iframe>
  1886. </li>
  1887. <li>
  1888. <iframe class="github-btn"
  1889. src="http://ghbtns.com/github-btn.html?user=wenzhixin&repo=bootstrap-table&type=fork&count=true"
  1890. width="102" height="20" title="Fork on GitHub"></iframe>
  1891. </li>
  1892. <li>
  1893. <iframe class="github-btn" src="http://ghbtns.com/github-btn.html?user=wenzhixin&type=follow&count=true"
  1894. width="175" height="20" title="Follow on GitHub"></iframe>
  1895. </li>
  1896. <!--<li>-->
  1897. <!-- https://about.twitter.com/resources/buttons#tweet -->
  1898. <!--<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://wenzhixin.net.cn/p/bootstrap-table" data-via="BootstrapTable" data-related="BootstrapTable">Tweet</a>-->
  1899. <!--</li>-->
  1900. <!--<li>-->
  1901. <!--将此标记放置在你希望显示+1 按钮的位置。 -->
  1902. <!--<div class="g-plusone" data-annotation="inline" data-width="120"></div>-->
  1903. <!--</li>-->
  1904. <!--<li>-->
  1905. <!--<div>QQ group: 103558783</div>-->
  1906. <!--</li>-->
  1907. </ul>
  1908. Questions/Helps:
  1909. <ul class="bs-docs-social-buttons">
  1910. <li>
  1911. <a class="help-btn" href="http://stackoverflow.com/questions/tagged/bootstrap-table">StackOverflow</a>
  1912. </li>
  1913. <li>
  1914. <a class="help-btn" href="http://segmentfault.com/t/bootstrap-table">SegmentFault</a>
  1915. </li>
  1916. </ul>
  1917. </div>
  1918. <p>Designed and built with all the love in the world by <a href="https://github.com/wenzhixin" target="_blank">@wenzhixin</a>.</p>
  1919. <p>Maintained by <a href="https://github.com/wenzhixin" target="_blank">@wenzhixin</a> with the help of <a href="https://github.com/wenzhixin/bootstrap-table/graphs/contributors" target="_blank">our contributors</a>.</p>
  1920. <p>Code licensed under <a href="https://github.com/wenzhixin/bootstrap-table/blob/master/LICENSE" target="_blank">MIT</a>, documentation under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
  1921. <ul class="bs-docs-footer-links muted">
  1922. <li>Currently v1.13.0</li>
  1923. <li>&middot;</li>
  1924. <li><a href="https://github.com/wenzhixin/bootstrap-table">GitHub</a></li>
  1925. <li>&middot;</li>
  1926. <li><a href="http://wenzhixin.net.cn">My website</a></li>
  1927. <li>&middot;</li>
  1928. <li><a href="http://repos.wenzhixin.net.cn">My repos</a></li>
  1929. <li>&middot;</li>
  1930. <li><a href="http://stackoverflow.com/questions/tagged/bootstrap-table">Questions / Helps</a></li>
  1931. <li>&middot;</li>
  1932. <li><a href="https://github.com/wenzhixin/bootstrap-table/issues">Issues</a></li>
  1933. <li>&middot;</li>
  1934. <li><a href="https://github.com/wenzhixin/bootstrap-table/releases">Releases</a></li>
  1935. <li>&middot;</li>
  1936. <li><a href="mailto:wenzhixin2010@gmail.com">Email</a></li>
  1937. </ul>
  1938. </div>
  1939. </footer>
  1940. <!-- Bootstrap core JavaScript
  1941. ================================================== -->
  1942. <!-- Placed at the end of the document so the pages load faster -->
  1943. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
  1944. <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
  1945. <script src="https://unpkg.com/bootstrap-table/dist/bootstrap-table.min.js"></script>
  1946. <script src="https://unpkg.com/bootstrap-table/dist/extensions/mobile/bootstrap-table-mobile.min.js"></script>
  1947. <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  1948. <script src="../assets/js/ie10-viewport-bug-workaround.js"></script>
  1949. <script src="../assets/js/sidenav.js?v=1.13.0"></script>
  1950. <script src="../assets/js/common.js?v=1.13.0"></script>
  1951. </body>
  1952. </html>