Skip to content

Commit aa969da

Browse files
committed
Merge pull request wenzhixin#548 from NaughtyMC/patch-1
Fixes wenzhixin#536
2 parents 0362b8f + ee6cef5 commit aa969da

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

docs/_i18n/en/documentation/events.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,10 @@
130130
<td>none</td>
131131
<td>Fires after the table body is rendered and available in the DOM</td>
132132
</tr>
133+
<tr>
134+
<td>onPostHeader</td>
135+
<td>post-header.bs.table</td>
136+
<td>none</td>
137+
<td>Fires after the table header is rendered and availble in the DOM</td>
133138
</tbody>
134139
</table>

src/bootstrap-table.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@
195195
onPageChange: function (number, size) {return false;},
196196
onSearch: function (text) {return false;},
197197
onPreBody: function (data) {return false;},
198-
onPostBody: function () {return false;}
198+
onPostBody: function () {return false;},
199+
onPostHeader: function() {return false;}
199200
};
200201

201202
BootstrapTable.LOCALES = [];
@@ -270,7 +271,8 @@
270271
'page-change.bs.table': 'onPageChange',
271272
'search.bs.table': 'onSearch',
272273
'pre-body.bs.table': 'onPreBody',
273-
'post-body.bs.table': 'onPostBody'
274+
'post-body.bs.table': 'onPostBody',
275+
'post-header.bs.table' : 'onPostHeader'
274276
};
275277

276278
BootstrapTable.prototype.init = function () {
@@ -1329,6 +1331,8 @@
13291331
$fixedBody.off('scroll').on('scroll', function () {
13301332
$fixedHeader.scrollLeft($(this).scrollLeft());
13311333
});
1334+
1335+
that.trigger('post-header');
13321336
});
13331337
};
13341338

@@ -1386,6 +1390,8 @@
13861390

13871391
if (this.options.showHeader && this.options.height) {
13881392
this.resetHeader();
1393+
} else {
1394+
this.trigger('post-header');
13891395
}
13901396

13911397
if (this.options.height && this.options.showHeader) {

0 commit comments

Comments
 (0)