docs.js 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. $(function () {
  2. 'use strict';
  3. function initTables() {
  4. var cardView = false;
  5. if ($(window).width() < 640) {
  6. cardView = true;
  7. }
  8. $('#table, #column, #event, #method, #localization').bootstrapTable('destroy');
  9. var tableColumns = [
  10. {field: 'name', title: 'Name', sortable: true},
  11. {field: 'name', title: '名称', sortable: true, visible: false},
  12. {field: 'attribute', title: 'Attribute'},
  13. {field: 'attribute', title: '属性', visible: false},
  14. {field: 'type', title: 'Type'},
  15. {field: 'type', title: '类型', visible: false},
  16. {field: 'description', title: 'Description', align: 'left'},
  17. {field: 'description_zh', title: '描述', align: 'left', visible: false},
  18. {field: 'default', title: 'Default', align: 'left'},
  19. {field: 'default', title: '默认', align: 'left', visible: false},
  20. {field: 'example', title: '', valign: 'middle', formatter: function (value) {
  21. if (!value) {
  22. return '-';
  23. }
  24. return [
  25. '<a title="Example" href="examples.html#' + value + '">',
  26. '<i class="glyphicon glyphicon-eye-open"></i>',
  27. '</a>'].join('');
  28. }}
  29. ];
  30. var columnColumns = [
  31. {field: 'name', title: 'Name', width: 60, sortable: true},
  32. {field: 'name', title: '名称', width: 60, sortable: true, visible: false},
  33. {field: 'attribute', title: 'Attribute'},
  34. {field: 'attribute', title: '属性', visible: false},
  35. {field: 'type', title: 'Type', width: 60},
  36. {field: 'type', title: '类型', width: 60, visible: false},
  37. {field: 'description', title: 'Description', align: 'left', width: 400},
  38. {field: 'description_zh', title: '描述', align: 'left', width: 400, visible: false},
  39. {field: 'default', title: 'Default', align: 'left', width: 180},
  40. {field: 'default', title: '默认', align: 'left', width: 180, visible: false},
  41. {field: 'example', title: '', formatter: function (value) {
  42. if (!value) {
  43. return '-';
  44. }
  45. return [
  46. '<a title="Example" href="examples.html#' + value + '">',
  47. '<i class="glyphicon glyphicon-eye-open"></i>',
  48. '</a>'].join('');
  49. }}
  50. ];
  51. if (getLocale() === 'zh') {
  52. $.each([tableColumns, columnColumns], function (i, columns) {
  53. $.each(columns, function (j, row) {
  54. if (row.field === 'example') {
  55. return;
  56. }
  57. row.visible = typeof row.visible !== 'undefined';
  58. });
  59. });
  60. }
  61. $('#table').bootstrapTable({
  62. cardView: cardView,
  63. columns: tableColumns,
  64. data: [
  65. {
  66. name: '-',
  67. attribute: 'data-toggle',
  68. type: 'String',
  69. description: 'Activate bootstrap table without writing JavaScript.',
  70. description_zh: '不通过JavaScript的方式启动Bootstrap Table。',
  71. 'default': 'table',
  72. example: 'basic-table'
  73. },
  74. {
  75. name: 'classes',
  76. attribute: 'data-classes',
  77. type: 'String',
  78. description: 'The class name of table.',
  79. description_zh: '表格的类名。',
  80. 'default': 'table table-hover',
  81. example: 'classes-table'
  82. },
  83. {
  84. name: 'height',
  85. attribute: 'data-height',
  86. type: 'Number',
  87. description: 'The height of table.',
  88. description_zh: '表格的高度。',
  89. 'default': 'undefined',
  90. example: 'basic-table'
  91. },
  92. {
  93. name: 'undefinedText',
  94. attribute: 'data-undefined-text',
  95. type: 'String',
  96. description: 'Defines the default undefined text.',
  97. description_zh: '定义默认的undefined显示文字。',
  98. 'default': '-',
  99. example: ''
  100. },
  101. {
  102. name: 'striped',
  103. attribute: 'data-striped',
  104. type: 'Boolean',
  105. description: 'True to stripe the rows.',
  106. description_zh: '使表格带有条纹。',
  107. 'default': 'false',
  108. example: 'classes-table'
  109. },
  110. {
  111. name: 'sortName',
  112. attribute: 'data-sort-name',
  113. type: 'String',
  114. description: 'Defines which column can be sorted.',
  115. description_zh: '定义哪一列可被排序。',
  116. 'default': 'undefined',
  117. example: 'sort-table'
  118. },
  119. {
  120. name: 'sortOrder',
  121. attribute: 'data-sort-order',
  122. type: 'String',
  123. description: 'Defines the column sort order, can only be "asc" or "desc".',
  124. description_zh: '定义列排序的顺序,只能为“asc”和“desc”',
  125. 'default': 'asc',
  126. example: 'sort-table'
  127. },
  128. {
  129. name: 'columns',
  130. attribute: '-',
  131. type: 'Array',
  132. description: 'The table columns config object, see column properties for more details.',
  133. description_zh: '表格列的配置,详细见列属性。',
  134. 'default': '[]',
  135. example: 'via-javascript-table'
  136. },
  137. {
  138. name: 'data',
  139. attribute: '-',
  140. type: 'Array',
  141. description: 'The data to be loaded.',
  142. description_zh: '需要加载的数据。',
  143. 'default': '[]',
  144. example: 'table-methods'
  145. },
  146. {
  147. name: 'method',
  148. attribute: 'data-method',
  149. type: 'String',
  150. description: 'The method type to request remote data.',
  151. description_zh: '远程数据请求的方法。',
  152. 'default': 'get',
  153. example: 'basic-table'
  154. },
  155. {
  156. name: 'url',
  157. attribute: 'data-url',
  158. type: 'String',
  159. description: 'A URL to request data from remote site.',
  160. description_zh: '远程数据请求的URL地址。',
  161. 'default': 'undefined',
  162. example: 'basic-table'
  163. },
  164. {
  165. name: 'contentType',
  166. attribute: 'data-content-type',
  167. type: 'String',
  168. description: 'The contentType of request remote data.',
  169. description_zh: '远程数据请求的“contentType”类型。',
  170. 'default': 'application/json',
  171. example: ''
  172. },
  173. {
  174. name: 'queryParams',
  175. attribute: 'data-query-params',
  176. type: 'Function',
  177. description: 'When request remote data, sending additional parameters by format the queryParams, the parameters object contains: <br>pageSize, pageNumber, searchText, sortName, sortOrder.',
  178. description_zh: '远程数据请求时,可以通过queryParams来格式化所需要的数据信息,参数(对象)包含了:<br>pageSize, pageNumber, searchText, sortName, sortOrder。',
  179. 'default': 'function(params) {<br>return {};<br>}',
  180. example: 'server-side-pagination-table'
  181. },
  182. {
  183. name: 'queryParamsType',
  184. attribute: 'data-query-params-type',
  185. type: 'String',
  186. description: 'Set "limit" to send query params width RESTFul type.',
  187. description_zh: '设置为“limit”可以发送标准的RESTFul类型的参数请求。',
  188. 'default': 'undefined',
  189. example: ''
  190. },
  191. {
  192. name: 'responseHandler',
  193. attribute: 'data-response-handler',
  194. type: 'Function',
  195. description: 'Before load remote data, handler the response data format, the parameters object contains: <br>res: the response data.',
  196. description_zh: '在加载数据前,可以对返回的数据进行处理,参数包含:<br>res: 返回的数据。',
  197. 'default': 'function(res) {<br>return res;<br>}',
  198. example: 'card-view'
  199. },
  200. {
  201. name: 'pagination',
  202. attribute: 'data-pagination',
  203. type: 'Boolean',
  204. description: 'True to show a pagination toolbar on table bottom.',
  205. description_zh: '设置True在表格底部显示分页工具栏。',
  206. 'default': 'false',
  207. example: 'pagination-table'
  208. },
  209. {
  210. name: 'sidePagination',
  211. attribute: 'data-side-pagination',
  212. type: 'String',
  213. description: 'Defines the side pagination of table, can only be "client" or "server".',
  214. description_zh: '定义表格分页的位置,只能是“client”(客户端)和“server”(服务器端)。',
  215. 'default': 'client',
  216. example: 'pagination-table'
  217. },
  218. {
  219. name: 'totalRows',
  220. attribute: 'data-total-rows',
  221. type: 'Number',
  222. description: 'Defines the total rows of table, you need to set this option when the sidePagination option is set to "server".',
  223. description_zh: '定义表格记录的总条数,在server端分页的时候需要设置该参数。',
  224. 'default': 0,
  225. example: ''
  226. },
  227. {
  228. name: 'pageNumber',
  229. attribute: 'data-page-number',
  230. type: 'Number',
  231. description: 'When set pagination property, initialize the page number.',
  232. description_zh: '分页的时候设置当前的页码。',
  233. 'default': 1,
  234. example: 'via-javascript-table'
  235. },
  236. {
  237. name: 'pageSize',
  238. attribute: 'data-page-size',
  239. type: 'Number',
  240. description: 'When set pagination property, initialize the page size.',
  241. description_zh: '分页的时候设置每页的条数。',
  242. 'default': 10,
  243. example: 'via-javascript-table'
  244. },
  245. {
  246. name: 'pageList',
  247. attribute: 'data-page-list',
  248. type: 'Array',
  249. description: 'When set pagination property, initialize the page size selecting list.',
  250. description_zh: '分页的时候设置分页数的列表。',
  251. 'default': '[10, 25, 50, 100]',
  252. example: 'via-javascript-table'
  253. },
  254. {
  255. name: 'search',
  256. attribute: 'data-search',
  257. type: 'Boolean',
  258. description: 'Enable the search input.',
  259. description_zh: '启用搜索输入框。',
  260. 'default': 'false',
  261. example: 'pagination-table'
  262. },
  263. {
  264. name: 'selectItemName',
  265. attribute: 'data-select-item-name',
  266. type: 'String',
  267. description: 'The name of radio or checkbox input.',
  268. description_zh: '单选框或者复选框的name,用于多个表格使用radio的情况。',
  269. 'default': 'btSelectItem',
  270. example: 'radio-table'
  271. },
  272. {
  273. name: 'showHeader',
  274. attribute: 'data-show-header',
  275. type: 'Boolean',
  276. description: 'False to hide the table header.',
  277. description_zh: '设置为False可隐藏表头。',
  278. 'default': 'true',
  279. example: 'hide-header-table'
  280. },
  281. {
  282. name: 'showColumns',
  283. attribute: 'data-show-columns',
  284. type: 'Boolean',
  285. description: 'True to show the columns drop down list.',
  286. description_zh: '设置为True可显示表格显示/隐藏列表。',
  287. 'default': 'false',
  288. example: 'show-columns-table'
  289. },
  290. {
  291. name: 'showRefresh',
  292. attribute: 'data-show-refresh',
  293. type: 'Boolean',
  294. description: 'True to show the refresh button.',
  295. description_zh: '设置为True可显示刷新按钮。',
  296. 'default': 'false',
  297. example: 'basic-toolbar-table'
  298. },
  299. {
  300. name: 'showToggle',
  301. attribute: 'data-show-toggle',
  302. type: 'Boolean',
  303. description: 'True to show the toggle button to toggle table / card view.',
  304. description_zh: '设置为True可显示切换普通表格和名片(card)布局。',
  305. 'default': 'false',
  306. example: 'basic-toolbar-table'
  307. },
  308. {
  309. name: 'minimumCountColumns',
  310. attribute: 'data-minimum-count-columns',
  311. type: 'Number',
  312. description: 'The minimum count columns to hide of the columns drop down list.',
  313. description_zh: '表格显示/隐藏列表时可设置最小隐藏的列数。',
  314. 'default': '1',
  315. example: 'via-javascript-table'
  316. },
  317. {
  318. name: 'idField',
  319. attribute: 'data-id-field',
  320. type: 'String',
  321. description: 'Indicate which field is an identity field.',
  322. description_zh: '标识哪个字段为id主键。',
  323. 'default': 'undefined',
  324. example: ''
  325. },
  326. {
  327. name: 'cardView',
  328. attribute: 'data-card-view',
  329. type: 'Boolean',
  330. description: 'True to show card view table, for example mobile view.',
  331. description_zh: '设置为True时显示名片(card)布局,例如用手机浏览的时候。',
  332. 'default': 'false',
  333. example: 'card-view'
  334. },
  335. {
  336. name: 'clickToSelect',
  337. attribute: 'data-click-to-select',
  338. type: 'Boolean',
  339. description: 'True to select checkbox or radiobox when click rows.',
  340. description_zh: '设置为True时点击行即可选中单选/复选框。',
  341. 'default': 'false',
  342. example: 'table-select'
  343. },
  344. {
  345. name: 'singleSelect',
  346. attribute: 'data-single-select',
  347. type: 'Boolean',
  348. description: 'True to allow checkbox selecting only one row.',
  349. description_zh: '设置为True时复选框只能选择一条记录。',
  350. 'default': 'false',
  351. example: 'single-checkbox-table'
  352. },
  353. {
  354. name: 'toolbar',
  355. attribute: 'data-toolbar',
  356. type: 'String',
  357. description: 'A jQuery selector that indicate the toolbar, for example: <br>#toolbar, .toolbar.',
  358. description_zh: '设置jQuery元素为工具栏,例如:<br>#toolbar, .toolbar。',
  359. 'default': 'undefined',
  360. example: 'custom-toolbar-table'
  361. },
  362. {
  363. name: 'checkboxHeader',
  364. attribute: 'data-checkbox-header',
  365. type: 'Boolean',
  366. description: 'False to hide check-all checkbox in header row.',
  367. description_zh: '设置为False时隐藏表头中的全选复选框。',
  368. 'default': 'true',
  369. example: ''
  370. },
  371. {
  372. name: 'sortable',
  373. attribute: 'data-sortable',
  374. type: 'Boolean',
  375. description: 'False to disable sortable of all columns.',
  376. description_zh: '设置为False时禁用所有列的排序。',
  377. 'default': 'true',
  378. example: ''
  379. },
  380. {
  381. name: 'rowStyle',
  382. attribute: 'data-row-style',
  383. type: 'Function',
  384. description: 'The row style formatter function, take two parameters: <br>row: the row record data.<br>index: the row index.<br>Support classes or css.',
  385. description_zh: '行样式格式化方法,有两个参数:<br>row: 行记录的数据。<br>index: 行数据的 index。<br>支持 classes 或者 css.',
  386. 'default': '{}',
  387. example: 'classes-table'
  388. }
  389. ]
  390. });
  391. $('#column').bootstrapTable({
  392. cardView: cardView,
  393. columns: columnColumns,
  394. data: [
  395. {
  396. name: 'radio',
  397. attribute: 'data-radio',
  398. type: 'Boolean',
  399. description: 'True to show a radio. The radio column has fixed width.',
  400. description_zh: '设置为True显示单选框,单选框列有固定的宽度。',
  401. 'default': 'false',
  402. example: 'radio-table'
  403. },
  404. {
  405. name: 'checkbox',
  406. attribute: 'data-checkbox',
  407. type: 'Boolean',
  408. description: 'True to show a checkbox. The checkbox column has fixed width.',
  409. description_zh: '设置为True显示复选框,复选框列有固定的宽度。',
  410. 'default': 'false',
  411. example: 'checkbox-table'
  412. },
  413. {
  414. name: 'field',
  415. attribute: 'data-field',
  416. type: 'String',
  417. description: 'The column field name.',
  418. description_zh: '列标识名称。',
  419. 'default': 'undefined',
  420. example: 'via-javascript-table'
  421. },
  422. {
  423. name: 'title',
  424. attribute: 'data-title',
  425. type: 'String',
  426. description: 'The column title text.',
  427. description_zh: '表头标题。',
  428. 'default': 'undefined',
  429. example: 'via-javascript-table'
  430. },
  431. {
  432. name: 'class',
  433. attribute: 'class / data-class',
  434. type: 'String',
  435. description: 'The column class name.',
  436. description_zh: '列的类名称。',
  437. 'default': 'undefined',
  438. example: 'classes-table'
  439. },
  440. {
  441. name: 'align',
  442. attribute: 'data-align',
  443. type: 'String',
  444. description: 'Indicate how to align the column data. "left", "right", "center" can be used.',
  445. description_zh: '定义列的水平对齐方式,只能为:"left", "right" 和 "center"。',
  446. 'default': 'undefined',
  447. example: 'via-javascript-table'
  448. },
  449. {
  450. name: 'valign',
  451. attribute: 'data-valign',
  452. type: 'String',
  453. description: 'Indicate how to align the cell data. "top", "middle", "bottom" can be used.',
  454. description_zh: '定义列的垂直对齐方式,只能为:"top", "middle" 和 "bottom"。',
  455. 'default': 'undefined',
  456. example: 'via-javascript-table'
  457. },
  458. {
  459. name: 'width',
  460. attribute: 'data-width',
  461. type: 'Number',
  462. description: 'The width of column. If not defined, the width will auto expand to fit its contents.',
  463. description_zh: '列的宽度,假如没有定义,将根据内容自适应宽度。',
  464. 'default': 'undefined',
  465. example: ''
  466. },
  467. {
  468. name: 'sortable',
  469. attribute: 'data-sortable',
  470. type: 'Boolean',
  471. description: 'True to allow the column can be sorted.',
  472. description_zh: '设置为True允许对该列进行排序。',
  473. 'default': 'false',
  474. example: 'sort-table'
  475. },
  476. {
  477. name: 'order',
  478. attribute: 'data-order',
  479. type: 'String',
  480. description: 'The default sort order, can only be "asc" or "desc".',
  481. description_zh: '定义列排序的顺序,只能为“asc”和“desc”。',
  482. 'default': 'asc',
  483. example: 'sort-table'
  484. },
  485. {
  486. name: 'visible',
  487. attribute: 'data-visible',
  488. type: 'Boolean',
  489. description: 'False to hide the columns item.',
  490. description_zh: '设置为False隐藏该列。',
  491. 'default': 'true',
  492. example: 'show-columns-table'
  493. },
  494. {
  495. name: 'switchable',
  496. attribute: 'data-switchable',
  497. type: 'Boolean',
  498. description: 'False to disable the switchable of columns item.',
  499. description_zh: '设置为False禁用切换列的显示/隐藏。',
  500. 'default': 'true',
  501. example: 'show-columns-table'
  502. },
  503. {
  504. name: 'formatter',
  505. attribute: 'data-formatter',
  506. type: 'Function',
  507. description: 'The cell formatter function, take three parameters: <br />value: the field value. <br />row: the row record data.<br />index: the row index.',
  508. description_zh: '列的格式化方法,包含3个参数:<br />value: 该单元格的数据。<br />row: 该行的数据。<br />index: 该行的index。',
  509. 'default': 'undefined',
  510. example: 'format-table'
  511. },
  512. {
  513. name: 'events',
  514. attribute: 'data-events',
  515. type: 'Object',
  516. description: '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.',
  517. description_zh: '当你使用格式化方式时,可以对该列的元素进行事件监听。包含三个参数:<br />event: jQuery 事件。<br />value: 该单元格的数据。<br />row: 该行的数据。<br />index: 该行的index。',
  518. 'default': 'undefined',
  519. example: 'column-events-table'
  520. },
  521. {
  522. name: 'sorter',
  523. attribute: 'data-sorter',
  524. type: 'Function',
  525. description: '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.',
  526. description_zh: '可对列进行自定义排序,包含两个参数:<br />a: 第一个值。<br /> b: 第二个值。',
  527. 'default': 'undefined',
  528. example: 'custom-sort-table'
  529. },
  530. {
  531. name: 'clickToSelect',
  532. attribute: 'data-click-to-select',
  533. type: 'Boolean',
  534. description: 'True to select checkbox or radiobox when the column is clicked.',
  535. description_zh: '设置为True时点击行即可选中单选/复选框。',
  536. 'default': 'true',
  537. example: 'table-select'
  538. }
  539. ]
  540. });
  541. $('#event').bootstrapTable({
  542. cardView: cardView,
  543. columns: [
  544. {field: 'name', title: 'Option Event', width: 100, sortable: true},
  545. {field: 'event', title: 'jQuery Event', width: 100, sortable: true},
  546. {field: 'parameter', title: 'Parameter', width: 100, sortable: true},
  547. {field: 'description', title: 'Description', align: 'left', width: 400, sortable: true}
  548. ],
  549. data: [
  550. {
  551. name: 'onAll',
  552. event: 'all.bs.table',
  553. parameter: 'name, args',
  554. description: 'Fires when all events trigger, the parameters contains: <br />name: the event name, <br>args: the event data.'
  555. },
  556. {
  557. name: 'onClickRow',
  558. event: 'click-row.bs.table',
  559. parameter: 'row, $element',
  560. description: 'Fires when user click a row, the parameters contains: <br />row: the record corresponding to the clicked row, <br>$element: the tr element.'
  561. },
  562. {
  563. name: 'onDblClickRow',
  564. event: 'dbl-click-row.bs.table',
  565. parameter: 'row, $element',
  566. description: 'Fires when user click a row, the parameters contains: <br />row: the record corresponding to the clicked row, <br>$element: the tr element.'
  567. },
  568. {
  569. name: 'onSort',
  570. event: 'sort.bs.table',
  571. parameter: 'name, order',
  572. description: 'Fires when user sort a column, the parameters contains: <br />name: the sort column field name<br />order: the sort column order.'
  573. },
  574. {
  575. name: 'onCheck',
  576. event: 'check.bs.table',
  577. parameter: 'row',
  578. description: 'Fires when user check a row, the parameters contains: <br />row: the record corresponding to the clicked row.'
  579. },
  580. {
  581. name: 'onUncheck',
  582. event: 'uncheck.bs.table',
  583. parameter: 'row',
  584. description: 'Fires when user uncheck a row, the parameters contains: <br />row: the record corresponding to the clicked row.'
  585. },
  586. {
  587. name: 'onCheckAll',
  588. event: 'check-all.bs.table',
  589. parameter: 'none',
  590. description: 'Fires when user check all rows.'
  591. },
  592. {
  593. name: 'onUncheckAll',
  594. event: 'uncheck-all.bs.table',
  595. parameter: 'none',
  596. description: 'Fires when user uncheck all rows.'
  597. },
  598. {
  599. name: 'onLoadSuccess',
  600. event: 'load-success.bs.table',
  601. parameter: 'data',
  602. description: 'Fires when remote data is loaded successfully.'
  603. },
  604. {
  605. name: 'onLoadError',
  606. event: 'load-error.bs.table',
  607. parameter: 'status',
  608. description: 'Fires when some errors occur to load remote data.'
  609. }
  610. ],
  611. onClickRow: function (row) {
  612. console.log('onClickRow', row);
  613. },
  614. onSort: function (name, order) {
  615. console.log('onSort', name, order);
  616. },
  617. onCheck: function(row) {
  618. console.log('onCheck', row);
  619. },
  620. onUncheck: function(row) {
  621. console.log('onUncheck', row);
  622. },
  623. onCheckAll: function() {
  624. console.log('onCheckAll');
  625. },
  626. onUncheckAll: function() {
  627. console.log('onUncheckAll');
  628. }
  629. });
  630. $('#method').bootstrapTable({
  631. cardView: cardView,
  632. columns: [
  633. {field: 'name', title: 'Name', width: 100},
  634. {field: 'parameter', title: 'Parameter', width: 100},
  635. {field: 'description', title: 'Description', align: 'left', width: 400}
  636. ]
  637. }).bootstrapTable('load', [
  638. {name: 'getSelections', parameter: 'none', description: 'Return all selected rows, when no record selected, am empty array will return.'},
  639. {name: 'load', parameter: 'data', description: 'Load the data to table.'}
  640. ]).bootstrapTable('append', [
  641. {name: 'append', parameter: 'data', description: 'Append the data to table.'},
  642. {name: 'mergeCells', parameter: 'options', description: 'Merge some cells to one cell, the options contains following properties:'},
  643. {name: 'mergeCells', parameter: 'options', description: 'index: the row index.'},
  644. {name: 'mergeCells', parameter: 'options', description: 'field: the field name.'},
  645. {name: 'mergeCells', parameter: 'options', description: 'rowspan: the rowspan count to be merged.'},
  646. {name: 'mergeCells', parameter: 'options', description: 'colspan: the colspan count to be merged.'},
  647. {name: 'refresh', parameter: 'none', description: 'Refresh the remote server data.'},
  648. {name: 'showLoading', parameter: 'none', description: 'Show loading status.'},
  649. {name: 'hideLoading', parameter: 'none', description: 'Hide loading status.'},
  650. {name: 'checkAll', parameter: 'none', description: 'Check all current page rows.'},
  651. {name: 'uncheckAll', parameter: 'none', description: 'Uncheck all current page rows.'},
  652. {name: 'resetView', parameter: 'params', description: 'Reset the bootstrap table view, for example reset the table height.'},
  653. {name: 'destroy', parameter: 'none', description: 'Destroy the bootstrap table.'},
  654. {name: 'showColumn', parameter: 'field', description: 'Show the specified column.'},
  655. {name: 'hideColumn', parameter: 'field', description: 'Hide the specified column.'}
  656. ]).bootstrapTable('mergeCells', {
  657. index: 3,
  658. field: 'name',
  659. rowspan: 5
  660. }).bootstrapTable('mergeCells', {
  661. index: 3,
  662. field: 'parameter',
  663. rowspan: 5
  664. });
  665. $('#localization').bootstrapTable({
  666. cardView: cardView,
  667. columns: [
  668. {field: 'name', title: 'Name', width: 100},
  669. {field: 'parameter', title: 'Parameter', width: 100},
  670. {field: 'default', title: 'Default', width: 200}
  671. ],
  672. data: [{
  673. name: 'formatLoadingMessage',
  674. parameter: '-',
  675. 'default': 'Loading, please wait…'
  676. }, {
  677. name: 'formatRecordsPerPage',
  678. parameter: 'pageNumber',
  679. 'default': '%s records per page'
  680. }, {
  681. name: 'formatShowingRows',
  682. parameter: 'pageFrom, pageTo, totalRows',
  683. 'default': 'Showing %s to %s of %s rows'
  684. }, {
  685. name: 'formatSearch',
  686. parameter: '-',
  687. 'default': 'Search'
  688. }, {
  689. name: 'formatNoMatches',
  690. parameter: '-',
  691. 'default': 'No matching records found'
  692. }]
  693. });
  694. $('[title]').tooltip();
  695. }
  696. $(window).on('resize', initTables);
  697. initTables();
  698. });