zhaojs
2023-10-07 6c7bba2e05c011a3d640b6565a113204228e92e0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
 * @author: Jewway
 * @version: v1.0.0
 */
 
!function ($) {
  'use strict';
 
  var BootstrapTable = $.fn.bootstrapTable.Constructor;
 
  BootstrapTable.prototype.changeTitle = function (locale) {
    $.each(this.options.columns, function (idx, columnList) {
      $.each(columnList, function (idx, column) {
        if (column.field) {
          column.title = locale[column.field];
        }
      });
    });
 
    this.initHeader();
    this.initBody();
    this.initToolbar();
  };
 
  BootstrapTable.prototype.changeLocale = function (localeId) {
    this.options.locale = localeId;
    this.initLocale();
    this.initPagination();
  };
 
  $.fn.bootstrapTable.methods.push('changeTitle');
  $.fn.bootstrapTable.methods.push('changeLocale');
 
}(jQuery);