better-staridc-MNBT
1/**
2 * @author: Jewway
3 * @update zhixin wen <wenzhixin2010@gmail.com>
4 */
5
6$.fn.bootstrapTable.methods.push('changeTitle')
7$.fn.bootstrapTable.methods.push('changeLocale')
8
9$.BootstrapTable = class extends $.BootstrapTable {
10
11 changeTitle (locale) {
12 $.each(this.options.columns, (idx, columnList) => {
13 $.each(columnList, (idx, column) => {
14 if (column.field) {
15 column.title = locale[column.field]
16 }
17 })
18 })
19 this.initHeader()
20 this.initBody()
21 this.initToolbar()
22 }
23
24 changeLocale (localeId) {
25 this.options.locale = localeId
26 this.initLocale()
27 this.initPagination()
28 this.initBody()
29 this.initToolbar()
30 }
31}