UNPKG

1.75 kBMarkdownView Raw
1---
2layout: docs
3title: FAQ
4description: Frequently Asked Questions.
5group: faq
6redirect_from:
7 - "/faq/"
8 - "/zh-cn/faq/"
9 - "/es/faq/"
10toc: false
11---
12
13### When resizing the window, the table header does not adjust automatically, how to solve it?
14
15When you set the `height` of the bootstrap table, the `fixed header` feature is automatically enabled, that is what causes the problem, you need to listen to the `resize` event of the window and use the `resetView` method to solve this problem, code example:
16
17```js
18$(function () {
19 $('#tableId').bootstrapTable() // init via javascript
20
21 $(window).resize(function () {
22 $('#tableId').bootstrapTable('resetView')
23 })
24})
25```
26
27---
28
29### How to better merge cells?
30
31For merged cells, when you do refresh, next page or switch columns to show, the merge cells will be unmerged. We can listen the events(on load success, on column switch, on page change and on search) to solve this problem, code example:
32
33```js
34$table.on('load-success.bs.table column-switch.bs.table page-change.bs.table search.bs.table', function () {
35 $table.bootstrapTable('mergeCells', {...})
36})
37```
38
39---
40
41### Is event parameter put in the wrong order?
42
43When you use like this:
44
45```
46$('#eventsTable').on('click-row.bs.table', function (event, row, $element) {
47
48})
49```
50
51the first parameter is always `event`: [http://jsfiddle.net/wenyi/e3nk137y/11688/](http://jsfiddle.net/wenyi/e3nk137y/11688/)
52
53and use onClickRow event:
54
55```
56onClickRow: function (row, $element) {
57
58}
59```
60
61---
62
63### How can I support the development of bootstrap-table?
64
65All your ideas and feedback are very appreciated! Please feel free to open issues on GitHub or send me an email.
66
67I'm also grateful for your donations: <a href="/donate">Donate</a>.