ソースを参照

Update to v1.10.0

zhixin 10 年 前
コミット
5435887b74
100 ファイル変更1282 行追加415 行削除
  1. 30 10
      dist/bootstrap-table-locale-all.js
  2. 3 3
      dist/bootstrap-table-locale-all.min.js
  3. 3 2
      dist/bootstrap-table.css
  4. 158 54
      dist/bootstrap-table.js
  5. 1 1
      dist/bootstrap-table.min.css
  6. 4 5
      dist/bootstrap-table.min.js
  7. 2 2
      dist/extensions/accent-neutralise/bootstrap-table-accent-neutralise.min.js
  8. 2 2
      dist/extensions/angular/bootstrap-table-angular.min.js
  9. 8 4
      dist/extensions/cookie/bootstrap-table-cookie.js
  10. 3 3
      dist/extensions/cookie/bootstrap-table-cookie.min.js
  11. 21 0
      dist/extensions/editable/bootstrap-table-editable.js
  12. 3 3
      dist/extensions/editable/bootstrap-table-editable.min.js
  13. 9 2
      dist/extensions/export/bootstrap-table-export.js
  14. 3 3
      dist/extensions/export/bootstrap-table-export.min.js
  15. 127 46
      dist/extensions/filter-control/bootstrap-table-filter-control.js
  16. 3 3
      dist/extensions/filter-control/bootstrap-table-filter-control.min.js
  17. 2 2
      dist/extensions/filter/bootstrap-table-filter.min.js
  18. 2 2
      dist/extensions/flat-json/bootstrap-table-flat-json.min.js
  19. 7 0
      dist/extensions/group-by-v2/bootstrap-table-group-by.css
  20. 226 0
      dist/extensions/group-by-v2/bootstrap-table-group-by.js
  21. 7 0
      dist/extensions/group-by-v2/bootstrap-table-group-by.min.js
  22. 2 2
      dist/extensions/group-by/bootstrap-table-group-by.min.js
  23. 2 2
      dist/extensions/key-events/bootstrap-table-key-events.min.js
  24. 5 0
      dist/extensions/mobile/bootstrap-table-mobile.js
  25. 3 3
      dist/extensions/mobile/bootstrap-table-mobile.min.js
  26. 2 2
      dist/extensions/multiple-search/bootstrap-table-multiple-search.min.js
  27. 2 2
      dist/extensions/multiple-sort/bootstrap-table-multiple-sort.min.js
  28. 12 2
      dist/extensions/natural-sorting/bootstrap-table-natural-sorting.js
  29. 3 3
      dist/extensions/natural-sorting/bootstrap-table-natural-sorting.min.js
  30. 2 2
      dist/extensions/reorder-columns/bootstrap-table-reorder-columns.min.js
  31. 1 0
      dist/extensions/reorder-rows/bootstrap-table-reorder-rows.js
  32. 3 3
      dist/extensions/reorder-rows/bootstrap-table-reorder-rows.min.js
  33. 2 2
      dist/extensions/resizable/bootstrap-table-resizable.min.js
  34. 22 0
      dist/extensions/sticky-header/bootstrap-table-sticky-header.css
  35. 104 0
      dist/extensions/sticky-header/bootstrap-table-sticky-header.js
  36. 7 0
      dist/extensions/sticky-header/bootstrap-table-sticky-header.min.js
  37. 2 2
      dist/extensions/toolbar/bootstrap-table-toolbar.min.js
  38. 2 2
      dist/locale/bootstrap-table-af-ZA.min.js
  39. 2 2
      dist/locale/bootstrap-table-ar-SA.min.js
  40. 7 6
      dist/locale/bootstrap-table-ca-ES.js
  41. 3 3
      dist/locale/bootstrap-table-ca-ES.min.js
  42. 2 2
      dist/locale/bootstrap-table-cs-CZ.min.js
  43. 2 2
      dist/locale/bootstrap-table-da-DK.min.js
  44. 2 2
      dist/locale/bootstrap-table-de-DE.min.js
  45. 2 2
      dist/locale/bootstrap-table-el-GR.min.js
  46. 2 2
      dist/locale/bootstrap-table-en-US.js
  47. 3 3
      dist/locale/bootstrap-table-en-US.min.js
  48. 2 2
      dist/locale/bootstrap-table-es-AR.min.js
  49. 2 2
      dist/locale/bootstrap-table-es-CR.min.js
  50. 2 2
      dist/locale/bootstrap-table-es-ES.min.js
  51. 2 2
      dist/locale/bootstrap-table-es-MX.min.js
  52. 2 2
      dist/locale/bootstrap-table-es-NI.min.js
  53. 2 2
      dist/locale/bootstrap-table-es-SP.min.js
  54. 2 2
      dist/locale/bootstrap-table-et-EE.min.js
  55. 2 2
      dist/locale/bootstrap-table-fa-IR.min.js
  56. 2 2
      dist/locale/bootstrap-table-fr-BE.min.js
  57. 2 2
      dist/locale/bootstrap-table-fr-FR.min.js
  58. 2 2
      dist/locale/bootstrap-table-hr-HR.min.js
  59. 2 2
      dist/locale/bootstrap-table-hu-HU.min.js
  60. 2 2
      dist/locale/bootstrap-table-it-IT.min.js
  61. 2 2
      dist/locale/bootstrap-table-ja-JP.min.js
  62. 2 2
      dist/locale/bootstrap-table-ka-GE.min.js
  63. 2 2
      dist/locale/bootstrap-table-ko-KR.min.js
  64. 2 2
      dist/locale/bootstrap-table-ms-MY.min.js
  65. 2 2
      dist/locale/bootstrap-table-nb-NO.min.js
  66. 3 3
      dist/locale/bootstrap-table-nl-NL.js
  67. 3 3
      dist/locale/bootstrap-table-nl-NL.min.js
  68. 2 2
      dist/locale/bootstrap-table-pl-PL.min.js
  69. 2 2
      dist/locale/bootstrap-table-pt-BR.min.js
  70. 2 2
      dist/locale/bootstrap-table-pt-PT.min.js
  71. 2 2
      dist/locale/bootstrap-table-ro-RO.min.js
  72. 3 0
      dist/locale/bootstrap-table-ru-RU.js
  73. 3 3
      dist/locale/bootstrap-table-ru-RU.min.js
  74. 2 2
      dist/locale/bootstrap-table-sk-SK.min.js
  75. 2 2
      dist/locale/bootstrap-table-sv-SE.min.js
  76. 2 2
      dist/locale/bootstrap-table-th-TH.min.js
  77. 2 2
      dist/locale/bootstrap-table-tr-TR.min.js
  78. 2 2
      dist/locale/bootstrap-table-uk-UA.min.js
  79. 2 2
      dist/locale/bootstrap-table-ur-PK.min.js
  80. 2 2
      dist/locale/bootstrap-table-vi-VN.min.js
  81. 2 2
      dist/locale/bootstrap-table-zh-CN.min.js
  82. 2 2
      dist/locale/bootstrap-table-zh-TW.js
  83. 3 3
      dist/locale/bootstrap-table-zh-TW.min.js
  84. 30 10
      docs/dist/bootstrap-table-locale-all.js
  85. 3 3
      docs/dist/bootstrap-table-locale-all.min.js
  86. 3 2
      docs/dist/bootstrap-table.css
  87. 158 54
      docs/dist/bootstrap-table.js
  88. 1 1
      docs/dist/bootstrap-table.min.css
  89. 4 5
      docs/dist/bootstrap-table.min.js
  90. 2 2
      docs/dist/extensions/accent-neutralise/bootstrap-table-accent-neutralise.min.js
  91. 2 2
      docs/dist/extensions/angular/bootstrap-table-angular.min.js
  92. 8 4
      docs/dist/extensions/cookie/bootstrap-table-cookie.js
  93. 3 3
      docs/dist/extensions/cookie/bootstrap-table-cookie.min.js
  94. 21 0
      docs/dist/extensions/editable/bootstrap-table-editable.js
  95. 3 3
      docs/dist/extensions/editable/bootstrap-table-editable.min.js
  96. 9 2
      docs/dist/extensions/export/bootstrap-table-export.js
  97. 3 3
      docs/dist/extensions/export/bootstrap-table-export.min.js
  98. 127 46
      docs/dist/extensions/filter-control/bootstrap-table-filter-control.js
  99. 3 3
      docs/dist/extensions/filter-control/bootstrap-table-filter-control.min.js
  100. 0 0
      docs/dist/extensions/filter/bootstrap-table-filter.min.js

+ 30 - 10
dist/bootstrap-table-locale-all.js

@@ -82,14 +82,15 @@
 
 /**
  * Bootstrap Table Catalan translation
- * Author: Marc Pina<iwalkalone69@gmail.com>
+ * Authors: Marc Pina<iwalkalone69@gmail.com>
+ *          Claudi Martinez<claudix.kernel@gmail.com>
  */
 (function ($) {
     'use strict';
 
     $.fn.bootstrapTable.locales['ca-ES'] = {
         formatLoadingMessage: function () {
-            return 'Si us plau esperi...';
+            return 'Espereu, si us plau...';
         },
         formatRecordsPerPage: function (pageNumber) {
             return pageNumber + ' resultats per pàgina';
@@ -98,19 +99,19 @@
             return 'Mostrant de ' + pageFrom + ' fins ' + pageTo + ' - total ' + totalRows + ' resultats';
         },
         formatSearch: function () {
-            return 'Buscar';
+            return 'Cerca';
         },
         formatNoMatches: function () {
             return 'No s\'han trobat resultats';
         },
         formatPaginationSwitch: function () {
-            return 'Amagar/Mostrar paginació';
+            return 'Amaga/Mostra paginació';
         },
         formatRefresh: function () {
-            return 'Refrescar';
+            return 'Refresca';
         },
         formatToggle: function () {
-            return 'Amagar/Mostrar';
+            return 'Alterna formatació';
         },
         formatColumns: function () {
             return 'Columnes';
@@ -285,7 +286,7 @@
             return 'Loading, please wait...';
         },
         formatRecordsPerPage: function (pageNumber) {
-            return pageNumber + ' records per page';
+            return pageNumber + ' rows per page';
         },
         formatShowingRows: function (pageFrom, pageTo, totalRows) {
             return 'Showing ' + pageFrom + ' to ' + pageTo + ' of ' + totalRows + ' rows';
@@ -316,6 +317,7 @@
     $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['en-US']);
 
 })(jQuery);
+
 /**
  * Bootstrap Table Spanish (Argentina) translation
  * Author: Felix Vera (felix.vera@gmail.com)
@@ -1048,13 +1050,28 @@
             return pageNumber + ' records per pagina';
         },
         formatShowingRows: function (pageFrom, pageTo, totalRows) {
-            return 'Toon ' + pageFrom + ' tot ' + pageTo + ' van ' + totalRows + ' records';
+            return 'Toon ' + pageFrom + ' tot ' + pageTo + ' van ' + totalRows + ' record' + ((totalRows > 1) ? 's' : '');
+        },
+        formatDetailPagination: function (totalRows) {
+            return 'Toon ' + totalRows + ' record' + ((totalRows > 1) ? 's' : '');
         },
         formatSearch: function () {
             return 'Zoeken';
         },
         formatNoMatches: function () {
             return 'Geen resultaten gevonden';
+        },
+        formatRefresh: function () {
+           return 'Vernieuwen';
+        },
+        formatToggle: function () {
+          return 'Omschakelen';
+        },
+        formatColumns: function () {
+          return 'Kolommen';
+        },
+        formatAllRows: function () {
+          return 'Alle';
         }
     };
 
@@ -1244,6 +1261,9 @@
         },
         formatColumns: function () {
             return 'Колонки';
+        },
+        formatClearFilters: function () {
+            return 'Очистить фильтры';
         }
     };
 
@@ -1571,13 +1591,13 @@
             return '搜尋';
         },
         formatNoMatches: function () {
-            return '沒有找符合的結果';
+            return '沒有找符合的結果';
         },
         formatPaginationSwitch: function () {
             return '隱藏/顯示分頁';
         },
         formatRefresh: function () {
-            return '刷新';
+            return '重新整理';
         },
         formatToggle: function () {
             return '切換';

ファイルの差分が大きいため隠しています
+ 3 - 3
dist/bootstrap-table-locale-all.min.js


+ 3 - 2
dist/bootstrap-table.css

@@ -1,6 +1,6 @@
 /**
  * @author zhixin wen <wenzhixin2010@gmail.com>
- * version: 1.8.1
+ * version: 1.10.0
  * https://github.com/wenzhixin/bootstrap-table/
  */
 
@@ -17,7 +17,7 @@
 .bootstrap-table .table:not(.table-condensed) > thead > tr > td,
 .bootstrap-table .table:not(.table-condensed) > tbody > tr > td,
 .bootstrap-table .table:not(.table-condensed) > tfoot > tr > td {
-    padding: 8px !important;
+    padding: 8px;
 }
 
 .bootstrap-table .table.table-no-bordered > thead > tr > th,
@@ -274,6 +274,7 @@
 .bootstrap-table .fixed-table-footer .table {
     border-bottom: none;
     border-radius: 0;
+    padding: 0 !important;
 }
 
 .pull-right .dropdown-menu {

+ 158 - 54
dist/bootstrap-table.js

@@ -1,6 +1,6 @@
 /**
  * @author zhixin wen <wenzhixin2010@gmail.com>
- * version: 1.9.1
+ * version: 1.10.0
  * https://github.com/wenzhixin/bootstrap-table/
  */
 
@@ -180,11 +180,12 @@
     var escapeHTML = function (text) {
         if (typeof text === 'string') {
             return text
-                .replace(/&/g, "&amp;")
-                .replace(/</g, "&lt;")
-                .replace(/>/g, "&gt;")
-                .replace(/"/g, "&quot;")
-                .replace(/'/g, "&#039;");
+                .replace(/&/g, '&amp;')
+                .replace(/</g, '&lt;')
+                .replace(/>/g, '&gt;')
+                .replace(/"/g, '&quot;')
+                .replace(/'/g, '&#039;')
+                .replace(/`/g, '&#x60;');
         }
         return text;
     };
@@ -211,17 +212,21 @@
         return dataAttr;
     };
 
-    var getItemField = function (item, field) {
+    var getItemField = function (item, field, escape) {
         var value = item;
 
         if (typeof field !== 'string' || item.hasOwnProperty(field)) {
-            return item[field];
+            return escape ? escapeHTML(item[field]) : item[field];
         }
         var props = field.split('.');
         for (var p in props) {
-            value = value[props[p]];
+            value = value && value[props[p]];
         }
-        return value;
+        return escape ? escapeHTML(value) : value;
+    };
+
+    var isIEBrowser = function () {
+        return !!(navigator.userAgent.indexOf("MSIE ") > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./));
     };
 
     // BOOTSTRAP TABLE CLASS DEFINITION
@@ -272,11 +277,10 @@
         paginationHAlign: 'right', //right, left
         paginationVAlign: 'bottom', //bottom, top, both
         paginationDetailHAlign: 'left', //right, left
-        paginationFirstText: '&laquo;',
         paginationPreText: '&lsaquo;',
         paginationNextText: '&rsaquo;',
-        paginationLastText: '&raquo;',
         search: false,
+        searchOnEnterKey: false,
         strictSearch: false,
         searchAlign: 'right',
         selectItemName: 'btSelectItem',
@@ -288,6 +292,7 @@
         showToggle: false,
         buttonsAlign: 'right',
         smartDisplay: true,
+        escape: true,
         minimumCountColumns: 1,
         idField: undefined,
         uniqueId: undefined,
@@ -619,7 +624,7 @@
         });
 
         // if options.data is setting, do not process tbody data
-        if (this.options.data.length) {
+        if (this.options.data) {
             return;
         }
 
@@ -763,7 +768,11 @@
             $(this).data(visibleColumns[$(this).data('field')]);
         });
         this.$container.off('click', '.th-inner').on('click', '.th-inner', function (event) {
-            if (that.options.sortable && $(this).parent().data().sortable) {
+            var target = $(this);
+            if (target.closest('.bootstrap-table')[0] !== that.$container[0])
+                return false;
+
+            if (that.options.sortable && target.parent().data().sortable) {
                 that.onSort(event);
             }
         });
@@ -790,8 +799,7 @@
         }
 
         this.$selectAll = this.$header.find('[name="btSelectAll"]');
-        this.$container.off('click', '[name="btSelectAll"]')
-            .on('click', '[name="btSelectAll"]', function () {
+        this.$selectAll.off('click').on('click', function () {
                 var checked = $(this).prop('checked');
                 that[checked ? 'checkAll' : 'uncheckAll']();
                 that.updateSelected();
@@ -845,8 +853,8 @@
                 if (that.header.sortNames[index]) {
                     name = that.header.sortNames[index];
                 }
-                var aa = getItemField(a, name),
-                    bb = getItemField(b, name),
+                var aa = getItemField(a, name, that.options.escape),
+                    bb = getItemField(b, name, that.options.escape),
                     value = calculateObjectValue(that.header, that.header.sorters[index], [aa, bb]);
 
                 if (value !== undefined) {
@@ -926,6 +934,9 @@
             $search,
             switchableCount = 0;
 
+        if (this.$toolbar.find('.bars').children().length) {
+            $('body').append($(this.options.toolbar));
+        }
         this.$toolbar.html('');
 
         if (typeof this.options.toolbar === 'string' || typeof this.options.toolbar === 'object') {
@@ -1002,7 +1013,7 @@
 
         html.push('</div>');
 
-        // Fix #188: this.showToolbar is for extentions
+        // Fix #188: this.showToolbar is for extensions
         if (this.showToolbar || html.length > 2) {
             this.$toolbar.append(html.join(''));
         }
@@ -1056,11 +1067,26 @@
             this.$toolbar.append(html.join(''));
             $search = this.$toolbar.find('.search input');
             $search.off('keyup drop').on('keyup drop', function (event) {
+                if (that.options.searchOnEnterKey) {
+                    if (event.keyCode !== 13) {
+                        return;
+                    }
+                }
+
                 clearTimeout(timeoutId); // doesn't matter if it's 0
                 timeoutId = setTimeout(function () {
                     that.onSearch(event);
                 }, that.options.searchTimeOut);
             });
+
+            if (isIEBrowser()) {
+                $search.off('mouseup').on('mouseup', function (event) {
+                    clearTimeout(timeoutId); // doesn't matter if it's 0
+                    timeoutId = setTimeout(function () {
+                        that.onSearch(event);
+                    }, that.options.searchTimeOut);
+                });
+            }
         }
     };
 
@@ -1076,6 +1102,7 @@
             return;
         }
         this.searchText = text;
+        this.options.searchText = text;
 
         this.options.pageNumber = 1;
         this.initSearch();
@@ -1111,7 +1138,7 @@
                         column = that.columns[getFieldIndex(that.columns, key)],
                         j = $.inArray(key, that.header.fields);
 
-                    // Fix #142: search use formated data
+                    // Fix #142: search use formatted data
                     if (column && column.searchFormatter) {
                         value = calculateObjectValue(column,
                             that.header.formatters[j], [value, item, i], value);
@@ -1243,7 +1270,6 @@
             html.push('</div>',
                 '<div class="pull-' + this.options.paginationHAlign + ' pagination">',
                 '<ul class="pagination' + sprintf(' pagination-%s', this.options.iconSize) + '">',
-                '<li class="page-first"><a href="javascript:void(0)">' + this.options.paginationFirstText + '</a></li>',
                 '<li class="page-pre"><a href="javascript:void(0)">' + this.options.paginationPreText + '</a></li>');
 
             if (this.totalPages < 5) {
@@ -1261,18 +1287,71 @@
                     from = to - 4;
                 }
             }
+
+            if (this.totalPages >= 6) {
+                if (this.options.pageNumber >= 3) {
+                    html.push('<li class="page-first' + (1 === this.options.pageNumber ? ' active' : '') + '">',
+                        '<a href="javascript:void(0)">', 1, '</a>',
+                        '</li>');
+
+                    from++;
+                }
+
+                if (this.options.pageNumber >= 4) {
+                    if (this.options.pageNumber == 4 || this.totalPages == 6 || this.totalPages == 7) {
+                        from--;
+                    } else {
+                        html.push('<li class="page-first-separator disabled">',
+                            '<a href="javascript:void(0)">...</a>',
+                            '</li>');
+                    }
+
+                    to--;
+                }
+            }
+
+            if (this.totalPages >= 7) {
+                if (this.options.pageNumber >= (this.totalPages - 2)) {
+                    from--;
+                }
+            }
+
+            if (this.totalPages == 6) {
+                if (this.options.pageNumber >= (this.totalPages - 2)) {
+                    to++;
+                }
+            } else if (this.totalPages >= 7) {
+                if (this.totalPages == 7 || this.options.pageNumber >= (this.totalPages - 3)) {
+                    to++;
+                }
+            }
+
             for (i = from; i <= to; i++) {
                 html.push('<li class="page-number' + (i === this.options.pageNumber ? ' active' : '') + '">',
                     '<a href="javascript:void(0)">', i, '</a>',
                     '</li>');
             }
 
+            if (this.totalPages >= 8) {
+                if (this.options.pageNumber <= (this.totalPages - 4)) {
+                    html.push('<li class="page-last-separator disabled">',
+                        '<a href="javascript:void(0)">...</a>',
+                        '</li>');
+                }
+            }
+
+            if (this.totalPages >= 6) {
+                if (this.options.pageNumber <= (this.totalPages - 3)) {
+                    html.push('<li class="page-last' + (this.totalPages === this.options.pageNumber ? ' active' : '') + '">',
+                        '<a href="javascript:void(0)">', this.totalPages, '</a>',
+                        '</li>');
+                }
+            }
+
             html.push(
                 '<li class="page-next"><a href="javascript:void(0)">' + this.options.paginationNextText + '</a></li>',
-                '<li class="page-last"><a href="javascript:void(0)">' + this.options.paginationLastText + '</a></li>',
                 '</ul>',
                 '</div>');
-
         }
         this.$pagination.html(html.join(''));
 
@@ -1284,14 +1363,6 @@
             $last = this.$pagination.find('.page-last');
             $number = this.$pagination.find('.page-number');
 
-            if (this.options.pageNumber <= 1) {
-                $first.addClass('disabled');
-                $pre.addClass('disabled');
-            }
-            if (this.options.pageNumber >= this.totalPages) {
-                $next.addClass('disabled');
-                $last.addClass('disabled');
-            }
             if (this.options.smartDisplay) {
                 if (this.totalPages <= 1) {
                     this.$pagination.find('div.pagination').hide();
@@ -1352,12 +1423,20 @@
     };
 
     BootstrapTable.prototype.onPagePre = function (event) {
-        this.options.pageNumber--;
+        if ((this.options.pageNumber - 1) == 0) {
+            this.options.pageNumber = this.options.totalPages;
+        } else {
+            this.options.pageNumber--;
+        }
         this.updatePagination(event);
     };
 
     BootstrapTable.prototype.onPageNext = function (event) {
-        this.options.pageNumber++;
+        if ((this.options.pageNumber + 1) > this.options.totalPages) {
+            this.options.pageNumber = 1;
+        } else {
+            this.options.pageNumber++;
+        }
         this.updatePagination(event);
     };
 
@@ -1453,7 +1532,7 @@
 
             $.each(this.header.fields, function (j, field) {
                 var text = '',
-                    value = getItemField(item, field),
+                    value = getItemField(item, field, that.options.escape),
                     type = '',
                     cellStyle = {},
                     id_ = '',
@@ -1512,8 +1591,8 @@
                     type = column.checkbox ? 'checkbox' : type;
                     type = column.radio ? 'radio' : type;
 
-                    text = [that.options.cardView ?
-                        '<div class="card-view">' : '<td class="bs-checkbox">',
+                    text = [sprintf(that.options.cardView ?
+                        '<div class="card-view %s">' : '<td class="bs-checkbox %s">', column['class'] || ''),
                         '<input' +
                         sprintf(' data-index="%s"', i) +
                         sprintf(' name="%s"', that.options.selectItemName) +
@@ -1582,7 +1661,7 @@
                 index = $td[0].cellIndex,
                 field = that.header.fields[that.options.detailView && !that.options.cardView ? index - 1 : index],
                 column = that.columns[getFieldIndex(that.columns, field)],
-                value = getItemField(item, field);
+                value = getItemField(item, field, that.options.escape);
 
             if ($td.find('.detail-icon').length) {
                 return;
@@ -1613,10 +1692,13 @@
                 that.trigger('collapse-row', index, row);
             } else {
                 $this.find('i').attr('class', sprintf('%s %s', that.options.iconsPrefix, that.options.icons.detailClose));
-                $tr.after(sprintf('<tr class="detail-view"><td colspan="%s">%s</td></tr>',
-                    $tr.find('td').length, calculateObjectValue(that.options,
-                        that.options.detailFormatter, [index, row], '')));
-                that.trigger('expand-row', index, row, $tr.next().find('td'));
+                $tr.after(sprintf('<tr class="detail-view"><td colspan="%s"></td></tr>', $tr.find('td').length));
+                var $element = $tr.next().find('td');
+                var content = calculateObjectValue(that.options, that.options.detailFormatter, [index, row, $element], '');
+                if($element.length === 1) {
+                    $element.append(content);
+                }
+                that.trigger('expand-row', index, row, $element);
             }
             that.resetView();
         });
@@ -1694,15 +1776,18 @@
         var that = this,
             data = {},
             params = {
-                pageSize: this.options.pageSize === this.options.formatAllRows() ?
-                    this.options.totalRows : this.options.pageSize,
-                pageNumber: this.options.pageNumber,
                 searchText: this.searchText,
                 sortName: this.options.sortName,
                 sortOrder: this.options.sortOrder
             },
             request;
 
+        if(this.options.pagination) {
+            params.pageSize = this.options.pageSize === this.options.formatAllRows() ?
+                this.options.totalRows : this.options.pageSize;
+            params.pageNumber = this.options.pageNumber;
+        }
+
         if (!this.options.url && !this.options.ajax) {
             return;
         }
@@ -1750,14 +1835,11 @@
 
                 that.load(res);
                 that.trigger('load-success', res);
+                if (!silent) that.$tableLoading.hide();
             },
             error: function (res) {
                 that.trigger('load-error', res.status, res);
-            },
-            complete: function () {
-                if (!silent) {
-                    that.$tableLoading.hide();
-                }
+                if (!silent) that.$tableLoading.hide();
             }
         });
 
@@ -2120,6 +2202,7 @@
         this.initData(data, 'append');
         this.initSearch();
         this.initPagination();
+        this.initSort();
         this.initBody(true);
     };
 
@@ -2127,6 +2210,7 @@
         this.initData(data, 'prepend');
         this.initSearch();
         this.initPagination();
+        this.initSort();
         this.initBody(true);
     };
 
@@ -2155,6 +2239,7 @@
 
         this.initSearch();
         this.initPagination();
+        this.initSort();
         this.initBody(true);
     };
 
@@ -2259,14 +2344,14 @@
     };
 
     BootstrapTable.prototype.showRow = function (params) {
-        if (!params.hasOwnProperty('index') || !params.hasOwnProperty('uniqueId')) {
+        if (!params.hasOwnProperty('index') && !params.hasOwnProperty('uniqueId')) {
             return;
         }
         this.toggleRow(params.index, params.uniqueId, true);
     };
 
     BootstrapTable.prototype.hideRow = function (params) {
-        if (!params.hasOwnProperty('index') || !params.hasOwnProperty('uniqueId')) {
+        if (!params.hasOwnProperty('index') && !params.hasOwnProperty('uniqueId')) {
             return;
         }
         this.toggleRow(params.index, params.uniqueId, false);
@@ -2318,6 +2403,10 @@
             return;
         }
         this.data[params.index][params.field] = params.value;
+
+        if (params.reinit === false) {
+            return;
+        }
         this.initSort();
         this.initBody(true);
     };
@@ -2525,7 +2614,7 @@
 
     BootstrapTable.prototype.refreshOptions = function (options) {
         //If the objects are equivalent then avoid the call of destroy / init methods
-        if (compareObjects(this.options, options, false)) {
+        if (compareObjects(this.options, options, true)) {
             return;
         }
         this.options = $.extend(this.options, options);
@@ -2604,6 +2693,21 @@
         }
     };
 
+    BootstrapTable.prototype.updateFormatText = function (name, text) {
+        if (this.options[sprintf('format%s', name)]) {
+            if (typeof text === 'string') {
+                this.options[sprintf('format%s', name)] = function () {
+                    return text;
+                };
+            } else if (typeof text === 'function') {
+                this.options[sprintf('format%s', name)] = text;
+            }
+        }
+        this.initToolbar();
+        this.initPagination();
+        this.initBody();
+    };
+
     // BOOTSTRAP TABLE PLUGIN DEFINITION
     // =======================
 
@@ -2631,7 +2735,8 @@
         'toggleView',
         'refreshOptions',
         'resetSearch',
-        'expandRow', 'collapseRow', 'expandAllRows', 'collapseAllRows'
+        'expandRow', 'collapseRow', 'expandAllRows', 'collapseAllRows',
+        'updateFormatText'
     ];
 
     $.fn.bootstrapTable = function (option) {
@@ -2686,5 +2791,4 @@
     $(function () {
         $('[data-toggle="table"]').bootstrapTable();
     });
-
 }(jQuery);

ファイルの差分が大きいため隠しています
+ 1 - 1
dist/bootstrap-table.min.css


ファイルの差分が大きいため隠しています
+ 4 - 5
dist/bootstrap-table.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/extensions/accent-neutralise/bootstrap-table-accent-neutralise.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/extensions/angular/bootstrap-table-angular.min.js


+ 8 - 4
dist/extensions/cookie/bootstrap-table-cookie.js

@@ -123,7 +123,7 @@
                 cookieExpire = cookieExpire * 30 * 24 * 60 * 60;
                 break;
             case 'y':
-                cookieExpire = cookieExpire * 365 * 30 * 24 * 60 * 60;
+                cookieExpire = cookieExpire * 365 * 24 * 60 * 60;
                 break;
             default:
                 cookieExpire = undefined;
@@ -203,7 +203,7 @@
                                 searchControls = getCurrentSearchControls(that);
 
                             header.find(searchControls).each(function (index, ele) {
-                                field = $(this).parent().parent().parent().data('field');
+                                field = $(this).closest('[data-field]').data('field');
                                 result = $.grep(filterControl, function (valueObj) {
                                     return valueObj.field === field;
                                 });
@@ -317,8 +317,12 @@
     };
 
     BootstrapTable.prototype.onSearch = function () {
-        _onSearch.apply(this, Array.prototype.slice.apply(arguments));
-        setCookie(this, cookieIds.searchText, this.searchText);
+        var target = Array.prototype.slice.apply(arguments);
+        _onSearch.apply(this, target);
+
+        if ($(target[0].currentTarget).parent().hasClass('search')) {
+          setCookie(this, cookieIds.searchText, this.searchText);
+        }
     };
 
     BootstrapTable.prototype.deleteCookie = function (cookieName) {

ファイルの差分が大きいため隠しています
+ 3 - 3
dist/extensions/cookie/bootstrap-table-cookie.min.js


+ 21 - 0
dist/extensions/editable/bootstrap-table-editable.js

@@ -47,14 +47,34 @@
                 return;
             }
 
+            var editableOptions = {}, editableDataMarkup = [], editableDataPrefix = 'editable-';
+
+            var processDataOptions = function(key, value) {
+              // Replace camel case with dashes.
+              var dashKey = key.replace(/([A-Z])/g, function($1){return "-"+$1.toLowerCase();});
+              if (dashKey.slice(0, editableDataPrefix.length) == editableDataPrefix) {
+                var dataKey = dashKey.replace(editableDataPrefix, 'data-');
+                editableOptions[dataKey] = value;
+              }
+            };
+
+            $.each(that.options, processDataOptions);
+
             var _formatter = column.formatter;
             column.formatter = function (value, row, index) {
                 var result = _formatter ? _formatter(value, row, index) : value;
 
+                $.each(column, processDataOptions);
+
+                $.each(editableOptions, function (key, value) {
+                    editableDataMarkup.push(' ' + key + '="' + value + '"');
+                });
+
                 return ['<a href="javascript:void(0)"',
                     ' data-name="' + column.field + '"',
                     ' data-pk="' + row[that.options.idField] + '"',
                     ' data-value="' + result + '"',
+                    editableDataMarkup.join(''),
                     '>' + '</a>'
                 ].join('');
             };
@@ -81,6 +101,7 @@
                         row = data[index],
                         oldValue = row[column.field];
 
+                    $(this).data('value', params.submitValue);
                     row[column.field] = params.submitValue;
                     that.trigger('editable-save', column.field, row, oldValue, $(this));
                 });

ファイルの差分が大きいため隠しています
+ 3 - 3
dist/extensions/editable/bootstrap-table-editable.min.js


+ 9 - 2
dist/extensions/export/bootstrap-table-export.js

@@ -5,6 +5,7 @@
 
 (function ($) {
     'use strict';
+    var sprintf = $.fn.bootstrapTable.utils.sprintf;
 
     var TYPE_NAME = {
         json: 'JSON',
@@ -27,6 +28,10 @@
         exportOptions: {}
     });
 
+    $.extend($.fn.bootstrapTable.defaults.icons, {
+        export: 'glyphicon-export icon-share'
+    });
+
     var BootstrapTable = $.fn.bootstrapTable.Constructor,
         _initToolbar = BootstrapTable.prototype.initToolbar;
 
@@ -43,9 +48,11 @@
             if (!$export.length) {
                 $export = $([
                     '<div class="export btn-group">',
-                        '<button class="btn btn-default dropdown-toggle" ' +
+                        '<button class="btn btn-default' +
+                            sprintf(' btn-%s', this.options.iconSize) +
+                            ' dropdown-toggle" ' +
                             'data-toggle="dropdown" type="button">',
-                            '<i class="glyphicon glyphicon-export icon-share"></i> ',
+                            sprintf('<i class="%s %s"></i> ', this.options.iconsPrefix, this.options.icons.export),
                             '<span class="caret"></span>',
                         '</button>',
                         '<ul class="dropdown-menu" role="menu">',

ファイルの差分が大きいため隠しています
+ 3 - 3
dist/extensions/export/bootstrap-table-export.min.js


+ 127 - 46
dist/extensions/filter-control/bootstrap-table-filter-control.js

@@ -11,8 +11,9 @@
     var sprintf = $.fn.bootstrapTable.utils.sprintf;
 
     var addOptionToSelectControl = function (selectControl, value, text) {
+        value = $.trim(value);
         selectControl = $(selectControl.get(selectControl.length - 1));
-        if (existsOptionInSelectControl(selectControl, value)) {
+        if (existOptionInSelectControl(selectControl, value)) {
             selectControl.append($("<option></option>")
                 .attr("value", value)
                 .text($('<div />').html(text).text()));
@@ -35,11 +36,11 @@
         }
     };
 
-    var existsOptionInSelectControl = function (selectControl, value) {
+    var existOptionInSelectControl = function (selectControl, value) {
         var options = selectControl.get(selectControl.length - 1).options;
         for (var i = 0; i < options.length; i++) {
             if (options[i].value === value.toString()) {
-                //The value is nor valid to add
+                //The value is not valid to add
                 return false;
             }
         }
@@ -74,12 +75,12 @@
         var header = getCurrentHeader(that),
             searchControls = getCurrentSearchControls(that);
 
-        that.options.values = [];
+        that.options.valuesFilterControl = [];
 
         header.find(searchControls).each(function () {
-            that.options.values.push(
+            that.options.valuesFilterControl.push(
                 {
-                    field: $(this).parent().parent().parent().data('field'),
+                    field: $(this).closest('[data-field]').data('field'),
                     value: $(this).val()
                 });
         });
@@ -91,10 +92,10 @@
             header = getCurrentHeader(that),
             searchControls = getCurrentSearchControls(that);
 
-        if (that.options.values.length > 0) {
+        if (that.options.valuesFilterControl.length > 0) {
             header.find(searchControls).each(function (index, ele) {
-                field = $(this).parent().parent().parent().data('field');
-                result = $.grep(that.options.values, function (valueObj) {
+                field = $(this).closest('[data-field]').data('field');
+                result = $.grep(that.options.valuesFilterControl, function (valueObj) {
                     return valueObj.field === field;
                 });
 
@@ -105,6 +106,24 @@
         }
     };
 
+    var collectBootstrapCookies = function cookiesRegex() {
+        var cookies = [],
+            foundCookies = document.cookie.match(/(?:bs.table.)(\w*)/g);
+
+        if (foundCookies) {
+            $.each(foundCookies, function (i, cookie) {
+                if (/./.test(cookie)) {
+                    cookie = cookie.split(".").pop();
+                }
+
+                if ($.inArray(cookie, cookies) === -1) {
+                    cookies.push(cookie);
+                }
+            });
+            return cookies;
+        }
+    };
+
     var createControls = function (that, header) {
         var addedFilterControl = false,
             isVisible,
@@ -122,24 +141,13 @@
             if (!column.filterControl) {
                 html.push('<div style="height: 34px;"></div>');
             } else {
-                html.push('<div style="margin: 0px 2px 2px 2px;" class="filterControl">');
+                html.push('<div style="margin: 0 2px 2px 2px;" class="filterControl">');
 
-                if (column.filterControl && column.searchable) {
+                var nameControl = column.filterControl.toLowerCase();
+                if (column.searchable && that.options.filterTemplate[nameControl]) {
                     addedFilterControl = true;
-                    isVisible = 'visible'
-                }
-                switch (column.filterControl.toLowerCase()) {
-                    case 'input' :
-                        html.push(sprintf('<input type="text" class="form-control" style="width: 100%; visibility: %s">', isVisible));
-                        break;
-                    case 'select':
-                        html.push(sprintf('<select class="%s form-control" style="width: 100%; visibility: %s"></select>',
-                            column.field, isVisible))
-                        break;
-                    case 'datepicker':
-                        html.push(sprintf('<input type="text" class="date-filter-control %s form-control" style="width: 100%; visibility: %s">',
-                            column.field, isVisible));
-                        break;
+                    isVisible = 'visible';
+                    html.push(that.options.filterTemplate[nameControl](that, column.field, isVisible));
                 }
             }
 
@@ -229,14 +237,42 @@
         }
     };
 
+    var getDirectionOfSelectOptions = function (alignment) {
+        alignment = alignment === undefined ? 'left' : alignment.toLowerCase();
+
+        switch (alignment) {
+            case 'left':
+                return 'ltr';
+            case 'right':
+                return 'rtl';
+            case 'auto':
+                return 'auto';
+            default:
+                return 'ltr'
+        }
+    };
+
     $.extend($.fn.bootstrapTable.defaults, {
         filterControl: false,
         onColumnSearch: function (field, text) {
             return false;
         },
         filterShowClear: false,
+        alignmentSelectControlOptions: undefined,
         //internal variables
-        values: []
+        valuesFilterControl: [],
+        filterTemplate: {
+            input: function (that, field, isVisible) {
+                return sprintf('<input type="text" class="form-control %s" style="width: 100%; visibility: %s">', field, isVisible);
+            },
+            select: function (that, field, isVisible) {
+                return sprintf('<select class="%s form-control" style="width: 100%; visibility: %s" dir="%s"></select>',
+                    field, isVisible, getDirectionOfSelectOptions(that.options.alignmentSelectControlOptions))
+            },
+            datepicker: function (that, field, isVisible) {
+                return sprintf('<input type="text" class="date-filter-control %s form-control" style="width: 100%; visibility: %s">', field, isVisible);
+            }
+        }
     });
 
     $.extend($.fn.bootstrapTable.COLUMN_DEFAULTS, {
@@ -250,6 +286,10 @@
         'column-search.bs.table': 'onColumnSearch'
     });
 
+    $.extend($.fn.bootstrapTable.defaults.icons, {
+        clear: 'glyphicon-trash icon-clear'
+    });
+
     var BootstrapTable = $.fn.bootstrapTable.Constructor,
         _init = BootstrapTable.prototype.init,
         _initToolbar = BootstrapTable.prototype.initToolbar,
@@ -258,11 +298,11 @@
         _initSearch = BootstrapTable.prototype.initSearch;
 
     BootstrapTable.prototype.init = function () {
-        //Make sure that the filtercontrol option is set
+        //Make sure that the filterControl option is set
         if (this.options.filterControl) {
             var that = this;
             //Make sure that the internal variables are set correctly
-            this.options.values = [];
+            this.options.valuesFilterControl = [];
 
             this.$el.on('reset-view.bs.table', function () {
                 //Create controls on $tableHeader if the height is set
@@ -282,13 +322,20 @@
                 if (that.options.height) {
                     fixHeaderCSS(that);
                 }
-            }).on('column-switch.bs.table', function(field, checked) {
+            }).on('column-switch.bs.table', function() {
                 setValues(that);
             });
         }
         _init.apply(this, Array.prototype.slice.apply(arguments));
     };
 
+    $.extend($.fn.bootstrapTable.locales, {
+        formatClearFilters: function () {
+            return 'Clear Filters';
+        }
+    });
+    $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
+
     BootstrapTable.prototype.initToolbar = function () {
         if ((!this.showToolbar) && (this.options.filterControl)) {
             this.showToolbar = this.options.filterControl;
@@ -302,9 +349,9 @@
 
             if (!$btnClear.length) {
               $btnClear = $([
-                    '<button class="btn btn-default " ' +
-                        'type="button">',
-                    '<i class="glyphicon glyphicon-trash icon-share"></i> ',
+                    '<button class="btn btn-default" ',
+                    sprintf('type="button" title="%s">', this.options.formatClearFilters()),
+                    sprintf('<i class="%s %s"></i> ', this.options.iconsPrefix, this.options.icons.clear),
                     '</button>',
                     '</ul>'].join('')).appendTo($btnGroup);
 
@@ -361,6 +408,10 @@
     BootstrapTable.prototype.initSearch = function () {
         _initSearch.apply(this, Array.prototype.slice.apply(arguments));
 
+        if (!this.options.sidePagination === 'server') {
+            return;
+        }
+
         var that = this;
         var fp = $.isEmptyObject(this.filterColumnsPartial) ? null : this.filterColumnsPartial;
 
@@ -370,24 +421,28 @@
                 var thisColumn = that.columns[$.fn.bootstrapTable.utils.getFieldIndex(that.columns, key)];
                 var fval = fp[key].toLowerCase();
                 var value = item[key];
-                value = $.fn.bootstrapTable.utils.calculateObjectValue(that.header,
+                
+                // Fix #142: search use formated data
+                if (thisColumn && thisColumn.searchFormatter) {
+                    value = $.fn.bootstrapTable.utils.calculateObjectValue(that.header,
                     that.header.formatters[$.inArray(key, that.header.fields)],
                     [value, item, i], value);
+                }
 
-                if(thisColumn.filterStrictSearch){
+                if (thisColumn.filterStrictSearch) {
                     if (!($.inArray(key, that.header.fields) !== -1 &&
                         (typeof value === 'string' || typeof value === 'number') &&
                         value.toString().toLowerCase() === fval.toString().toLowerCase())) {
                         return false;
                     }
                 }
-                else{
+                else {
                     if (!($.inArray(key, that.header.fields) !== -1 &&
                         (typeof value === 'string' || typeof value === 'number') &&
                         (value + '').toLowerCase().indexOf(fval) !== -1)) {
                         return false;
                     }
-                };
+                }
             }
             return true;
         }) : this.data;
@@ -396,7 +451,7 @@
     BootstrapTable.prototype.onColumnSearch = function (event) {
         copyValues(this);
         var text = $.trim($(event.currentTarget).val());
-        var $field = $(event.currentTarget).parent().parent().parent().data('field')
+        var $field = $(event.currentTarget).closest('[data-field]').data('field');
 
         if ($.isEmptyObject(this.filterColumnsPartial)) {
             this.filterColumnsPartial = {};
@@ -415,22 +470,48 @@
 
     BootstrapTable.prototype.clearFilterControl = function () {
         if (this.options.filterControl && this.options.filterShowClear) {
-            $.each(this.options.values, function (i, item) {
+            var that = this,
+                cookies = collectBootstrapCookies(),
+                header = getCurrentHeader(that),
+                table = header.closest('table'),
+                controls = header.find(getCurrentSearchControls(that)),
+                search = that.$toolbar.find('.search input'),
+                timeoutId = 0;
+
+            $.each(that.options.valuesFilterControl, function (i, item) {
                 item.value = '';
             });
 
-            setValues(this);
-
-            var controls = getCurrentHeader(this).find(getCurrentSearchControls(this)),
-                timeoutId = 0;
+            setValues(that);
 
+            // Clear each type of filter if it exists.
+            // Requires the body to reload each time a type of filter is found because we never know
+            // which ones are going to be present.
             if (controls.length > 0) {
                 this.filterColumnsPartial = {};
-                clearTimeout(timeoutId);
-                timeoutId = setTimeout(function () {
-                    $(controls[0]).trigger(controls[0].tagName === 'INPUT' ? 'keyup' : 'change');
-                }, this.options.searchTimeOut);
+                $(controls[0]).trigger(controls[0].tagName === 'INPUT' ? 'keyup' : 'change');
+            }
+
+            if (search.length > 0) {
+                that.resetSearch();
             }
+
+            // use the default sort order if it exists. do nothing if it does not
+            if (that.options.sortName !== table.data('sortName') || that.options.sortOrder !== table.data('sortOrder')) {
+                var sorter = sprintf(header.find('[data-field="%s"]', $(controls[0]).closest('table').data('sortName')));
+                that.onSort(table.data('sortName'), table.data('sortName'));
+                $(sorter).find('.sortable').trigger('click');
+            }
+
+            // clear cookies once the filters are clean
+            clearTimeout(timeoutId);
+            timeoutId = setTimeout(function () {
+                if (cookies && cookies.length > 0) {
+                    $.each(cookies, function (i, item) {
+                        that.deleteCookie(item);
+                    });
+                }
+            }, that.options.searchTimeOut);
         }
     };
 }(jQuery);

ファイルの差分が大きいため隠しています
+ 3 - 3
dist/extensions/filter-control/bootstrap-table-filter-control.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/extensions/filter/bootstrap-table-filter.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/extensions/flat-json/bootstrap-table-flat-json.min.js


+ 7 - 0
dist/extensions/group-by-v2/bootstrap-table-group-by.css

@@ -0,0 +1,7 @@
+.bootstrap-table .table > tbody > tr.groupBy {
+    cursor: pointer;
+}
+
+.bootstrap-table .table > tbody > tr.groupBy.expanded {
+
+}

+ 226 - 0
dist/extensions/group-by-v2/bootstrap-table-group-by.js

@@ -0,0 +1,226 @@
+/**
+ * @author: Yura Knoxville
+ * @version: v1.0.0
+ */
+
+!function ($) {
+
+    'use strict';
+
+    var initBodyCaller,
+        tableGroups;
+
+    // it only does '%s', and return '' when arguments are undefined
+    var sprintf = function (str) {
+        var args = arguments,
+            flag = true,
+            i = 1;
+
+        str = str.replace(/%s/g, function () {
+            var arg = args[i++];
+
+            if (typeof arg === 'undefined') {
+                flag = false;
+                return '';
+            }
+            return arg;
+        });
+        return flag ? str : '';
+    };
+
+    var groupBy = function (array , f) {
+        var groups = {};
+        array.forEach(function(o) {
+            var group = f(o);
+            groups[group] = groups[group] || [];
+            groups[group].push(o);
+        });
+
+        return groups;
+    };
+
+    $.extend($.fn.bootstrapTable.defaults, {
+        groupBy: false,
+        groupByField: ''
+    });
+
+    var BootstrapTable = $.fn.bootstrapTable.Constructor,
+        _initSort = BootstrapTable.prototype.initSort,
+        _initBody = BootstrapTable.prototype.initBody,
+        _updateSelected = BootstrapTable.prototype.updateSelected;
+
+    BootstrapTable.prototype.initSort = function () {
+        _initSort.apply(this, Array.prototype.slice.apply(arguments));
+
+        var that = this;
+        tableGroups = [];
+
+        if ((this.options.groupBy) && (this.options.groupByField !== '')) {
+
+            if ((this.options.sortName != this.options.groupByField)) {
+                this.data.sort(function(a, b) {
+                    return a[that.options.groupByField].localeCompare(b[that.options.groupByField]);
+                });
+            }
+
+            var that = this;
+            var groups = groupBy(that.data, function (item) {
+                return [item[that.options.groupByField]];
+            });
+
+            var index = 0;
+            $.each(groups, function(key, value) {
+                tableGroups.push({
+                    id: index,
+                    name: key
+                });
+
+                value.forEach(function(item) {
+                    if (!item._data) {
+                        item._data = {};
+                    }
+
+                    item._data['parent-index'] = index;
+                });
+
+                index++;
+            });
+        }
+    }
+
+    BootstrapTable.prototype.initBody = function () {
+        initBodyCaller = true;
+
+        _initBody.apply(this, Array.prototype.slice.apply(arguments));
+
+        if ((this.options.groupBy) && (this.options.groupByField !== '')) {
+            var that = this,
+                checkBox = false,
+                visibleColumns = 0;
+
+            this.columns.forEach(function(column) {
+                if (column.checkbox) {
+                    checkBox = true;
+                } else {
+                    if (column.visible) {
+                        visibleColumns += 1;
+                    }
+                }
+            });
+
+            if (this.options.detailView && !this.options.cardView) {
+                visibleColumns += 1;
+            }
+
+            tableGroups.forEach(function(item){
+                var html = [];
+
+                html.push(sprintf('<tr class="info groupBy expanded" data-group-index="%s">', item.id));
+
+                if (that.options.detailView && !that.options.cardView) {
+                    html.push('<td class="detail"></td>');
+                }
+
+                if (checkBox) {
+                    html.push('<td class="bs-checkbox">',
+                        '<input name="btSelectGroup" type="checkbox" />',
+                        '</td>'
+                    );
+                }
+
+                html.push('<td',
+                    sprintf(' colspan="%s"', visibleColumns),
+                    '>', item.name, '</td>'
+                );
+
+                html.push('</tr>');
+
+                that.$body.find('tr[data-parent-index='+item.id+']:first').before($(html.join('')));
+            });
+
+            this.$selectGroup = [];
+            this.$body.find('[name="btSelectGroup"]').each(function() {
+                var self = $(this);
+
+                that.$selectGroup.push({
+                    group: self,
+                    item: that.$selectItem.filter(function () {
+                        return ($(this).closest('tr').data('parent-index') ===
+                        self.closest('tr').data('group-index'));
+                    })
+                });
+            });
+
+            this.$container.off('click', '.groupBy')
+                .on('click', '.groupBy', function() {
+                    $(this).toggleClass('expanded');
+                    that.$body.find('tr[data-parent-index='+$(this).closest('tr').data('group-index')+']').toggleClass('hidden');
+                });
+
+            this.$container.off('click', '[name="btSelectGroup"]')
+                .on('click', '[name="btSelectGroup"]', function (event) {
+                    event.stopImmediatePropagation();
+
+                    var self = $(this);
+                    var checked = self.prop('checked');
+                    that[checked ? 'checkGroup' : 'uncheckGroup']($(this).closest('tr').data('group-index'));
+                });
+        }
+
+        initBodyCaller = false;
+        this.updateSelected();
+    };
+
+    BootstrapTable.prototype.updateSelected = function () {
+        if (!initBodyCaller) {
+            _updateSelected.apply(this, Array.prototype.slice.apply(arguments));
+
+            if ((this.options.groupBy) && (this.options.groupByField !== '')) {
+                this.$selectGroup.forEach(function (item) {
+                    var checkGroup = item.item.filter(':enabled').length ===
+                        item.item.filter(':enabled').filter(':checked').length;
+
+                    item.group.prop('checked', checkGroup);
+                });
+            }
+        }
+    };
+
+    BootstrapTable.prototype.getGroupSelections = function (index) {
+        var that = this;
+
+        return $.grep(this.data, function (row) {
+            return (row[that.header.stateField] && (row._data['parent-index'] === index));
+        });
+    };
+
+    BootstrapTable.prototype.checkGroup = function (index) {
+        this.checkGroup_(index, true);
+    };
+
+    BootstrapTable.prototype.uncheckGroup = function (index) {
+        this.checkGroup_(index, false);
+    };
+
+    BootstrapTable.prototype.checkGroup_ = function (index, checked) {
+        var rows;
+        var filter = function() {
+            return ($(this).closest('tr').data('parent-index') === index);
+        };
+
+        if (!checked) {
+            rows = this.getGroupSelections(index);
+        }
+
+        this.$selectItem.filter(filter).prop('checked', checked);
+
+
+        this.updateRows();
+        this.updateSelected();
+        if (checked) {
+            rows = this.getGroupSelections(index);
+        }
+        this.trigger(checked ? 'check-all' : 'uncheck-all', rows);
+    };
+
+}(jQuery);

ファイルの差分が大きいため隠しています
+ 7 - 0
dist/extensions/group-by-v2/bootstrap-table-group-by.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/extensions/group-by/bootstrap-table-group-by.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/extensions/key-events/bootstrap-table-key-events.min.js


+ 5 - 0
dist/extensions/mobile/bootstrap-table-mobile.js

@@ -98,6 +98,11 @@
             return;
         }
 
+        if (this.options.minWidth < 100 && this.options.resizable) {
+            console.log("The minWidth when the resizable extension is active should be greater or equal than 100");
+            this.options.minWidth = 100;
+        }
+
         var that = this,
             old = {
                 width: $(window).width(),

ファイルの差分が大きいため隠しています
+ 3 - 3
dist/extensions/mobile/bootstrap-table-mobile.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/extensions/multiple-search/bootstrap-table-multiple-search.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/extensions/multiple-sort/bootstrap-table-multiple-sort.min.js


+ 12 - 2
dist/extensions/natural-sorting/bootstrap-table-natural-sorting.js

@@ -2,10 +2,11 @@
  * @author: Brian Huisman
  * @webSite: http://www.greywyvern.com
  * @version: v1.0.0
- * JS function to allow natural sorting on bootstrap-table columns
- * just add data-sorter="alphanum" to any th
+ * JS functions to allow natural sorting on bootstrap-table columns
+ * add data-sorter="alphanum" or data-sorter="numericOnly" to any th
  *
  * @update Dennis Hernández <http://djhvscf.github.io/Blog>
+ * @update Duane May
  */
 
 function alphanum(a, b) {
@@ -44,4 +45,13 @@ function alphanum(a, b) {
     }
   }
   return aa.length - bb.length;
+}
+
+function numericOnly(a, b) {
+    function stripNonNumber(s) {
+        s = s.replace(new RegExp(/[^0-9]/g), "");
+        return parseInt(s, 10);
+    }
+
+    return stripNonNumber(a) - stripNonNumber(b);
 }

+ 3 - 3
dist/extensions/natural-sorting/bootstrap-table-natural-sorting.min.js

@@ -1,7 +1,7 @@
 /*
-* bootstrap-table - v1.9.1 - 2015-10-25
+* bootstrap-table - v1.10.0 - 2016-01-18
 * https://github.com/wenzhixin/bootstrap-table
-* Copyright (c) 2015 zhixin wen
+* Copyright (c) 2016 zhixin wen
 * Licensed MIT License
 */
-function alphanum(a,b){function c(a){for(var b,c,d=[],e=0,f=-1,g=0;b=(c=a.charAt(e++)).charCodeAt(0);){var h=46===b||b>=48&&57>=b;h!==g&&(d[++f]="",g=h),d[f]+=c}return d}var d=c(a),e=c(b);for(x=0;d[x]&&e[x];x++)if(d[x]!==e[x]){var f=Number(d[x]),g=Number(e[x]);return f==d[x]&&g==e[x]?f-g:d[x]>e[x]?1:-1}return d.length-e.length}
+function alphanum(a,b){function c(a){for(var b,c,d=[],e=0,f=-1,g=0;b=(c=a.charAt(e++)).charCodeAt(0);){var h=46===b||b>=48&&57>=b;h!==g&&(d[++f]="",g=h),d[f]+=c}return d}var d=c(a),e=c(b);for(x=0;d[x]&&e[x];x++)if(d[x]!==e[x]){var f=Number(d[x]),g=Number(e[x]);return f==d[x]&&g==e[x]?f-g:d[x]>e[x]?1:-1}return d.length-e.length}function numericOnly(a,b){function c(a){return a=a.replace(new RegExp(/[^0-9]/g),""),parseInt(a,10)}return c(a)-c(b)}

ファイルの差分が大きいため隠しています
+ 2 - 2
dist/extensions/reorder-columns/bootstrap-table-reorder-columns.min.js


+ 1 - 0
dist/extensions/reorder-rows/bootstrap-table-reorder-rows.js

@@ -45,6 +45,7 @@
     BootstrapTable.prototype.init = function () {
 
         if (!this.options.reorderableRows) {
+            _init.apply(this, Array.prototype.slice.apply(arguments));
             return;
         }
 

ファイルの差分が大きいため隠しています
+ 3 - 3
dist/extensions/reorder-rows/bootstrap-table-reorder-rows.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/extensions/resizable/bootstrap-table-resizable.min.js


+ 22 - 0
dist/extensions/sticky-header/bootstrap-table-sticky-header.css

@@ -0,0 +1,22 @@
+/**
+ * @author vincent loh <vincent.ml@gmail.com>
+ * @version: v1.0.0
+ * https://github.com/vinzloh/bootstrap-table/
+ * Sticky header for bootstrap-table
+ */
+
+.fix-sticky {
+    position: fixed;
+    z-index: 100;
+}
+.fix-sticky thead {
+    background: #fff;
+}
+
+.fix-sticky thead th,
+.fix-sticky thead th:first-child {
+    border-left: 0;
+    border-right: 0;
+    border-bottom: 1px solid #eee;
+    border-radius: 0;
+}

+ 104 - 0
dist/extensions/sticky-header/bootstrap-table-sticky-header.js

@@ -0,0 +1,104 @@
+/**
+ * @author vincent loh <vincent.ml@gmail.com>
+ * @version: v1.0.0
+ * https://github.com/vinzloh/bootstrap-table/
+ * Sticky header for bootstrap-table
+ */
+
+(function ($) {
+    'use strict';
+
+    var sprintf = $.fn.bootstrapTable.utils.sprintf;
+    $.extend($.fn.bootstrapTable.defaults, {
+        stickyHeader: false
+    });
+
+    var BootstrapTable = $.fn.bootstrapTable.Constructor,
+        _initHeader = BootstrapTable.prototype.initHeader;
+
+    BootstrapTable.prototype.initHeader = function () {
+        var that = this;
+        _initHeader.apply(this, Array.prototype.slice.apply(arguments));
+
+        if (!this.options.stickyHeader) return;
+
+        var table = this.$tableBody.find('table');
+        var table_id = table.attr('id');
+        var header_id = table.attr('id') + '-sticky-header';
+        var sticky_header_container_id = header_id +'-sticky-header-container';
+        var anchor_begin_id = header_id +'_sticky_anchor_begin';
+        var anchor_end_id = header_id +'_sticky_anchor_end';
+        // add begin and end anchors to track table position
+
+        table.before(sprintf('<div id="%s" class="hidden"></div>', sticky_header_container_id));
+        table.before(sprintf('<div id="%s"></div>', anchor_begin_id));
+        table.after(sprintf('<div id="%s"></div>', anchor_end_id));
+
+        table.find('thead').attr('id', header_id);
+
+        // clone header just once, to be used as sticky header
+        // deep clone header. using source header affects tbody>td width
+        this.$stickyHeader = $($('#'+header_id).clone());
+        // avoid id conflict
+        this.$stickyHeader.removeAttr('id');
+
+        // render sticky on window scroll or resize
+        $(window).on('resize.'+table_id, table, render_sticky_header);
+        $(window).on('scroll.'+table_id, table, render_sticky_header);
+        // render sticky when table scroll left-right
+        table.closest('.fixed-table-container').find('.fixed-table-body').on('scroll.'+table_id, table, match_position_x);
+
+        function render_sticky_header(event){
+            var table = event.data;
+            var table_header_id = table.find('thead').attr('id');
+            // console.log('render_sticky_header for > '+table_header_id);
+            if (table.length < 1 || $('#'+table_id).length < 1){
+                // turn off window listeners
+                $(window).off('resize.'+table_id);
+                $(window).off('scroll.'+table_id);
+                table.closest('.fixed-table-container').find('.fixed-table-body').off('scroll.'+table_id);
+                return;
+            }
+            // get header height
+            var header_height = '0';
+            if (that.options.stickyHeaderOffsetY) header_height = that.options.stickyHeaderOffsetY.replace('px','');
+            // window scroll top
+            var t = $(window).scrollTop();
+            // top anchor scroll position, minus header height
+            var e = $("#"+anchor_begin_id).offset().top - header_height;
+            // bottom anchor scroll position, minus header height, minus sticky height
+            var e_end = $("#"+anchor_end_id).offset().top - header_height - $('#'+table_header_id).css('height').replace('px','');
+            // show sticky when top anchor touches header, and when bottom anchor not exceeded
+            if (t > e && t <= e_end) {
+                // ensure clone and source column widths are the same
+                $.each( that.$stickyHeader.find('tr').eq(0).find('th'), function (index, item) {
+                    $(item).css('min-width', $('#'+table_header_id+' tr').eq(0).find('th').eq(index).css('width'));
+                });
+                // match bootstrap table style
+                $("#"+sticky_header_container_id).removeClass('hidden').addClass("fix-sticky fixed-table-container") ;
+                // stick it in position
+                $("#"+sticky_header_container_id).css('top', header_height + 'px');
+                // create scrollable container for header
+                var scrollable_div = $('<div style="position:absolute;width:100%;overflow-x:hidden;" />');
+                // append cloned header to dom
+                $("#"+sticky_header_container_id).html(scrollable_div.append(that.$stickyHeader));
+                // match clone and source header positions when left-right scroll
+                match_position_x(event);
+            } else {
+                // hide sticky
+                $("#"+sticky_header_container_id).removeClass("fix-sticky").addClass('hidden');
+            }
+
+        }
+        function match_position_x(event){
+            var table = event.data;
+            var table_header_id = table.find('thead').attr('id');
+            // match clone and source header positions when left-right scroll
+            $("#"+sticky_header_container_id).css(
+                'width', +table.closest('.fixed-table-body').css('width').replace('px', '') + 1
+            );
+            $("#"+sticky_header_container_id+" thead").parent().scrollLeft(Math.abs($('#'+table_header_id).position().left));
+        }
+    };
+
+})(jQuery);

ファイルの差分が大きいため隠しています
+ 7 - 0
dist/extensions/sticky-header/bootstrap-table-sticky-header.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/extensions/toolbar/bootstrap-table-toolbar.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-af-ZA.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-ar-SA.min.js


+ 7 - 6
dist/locale/bootstrap-table-ca-ES.js

@@ -1,13 +1,14 @@
 /**
  * Bootstrap Table Catalan translation
- * Author: Marc Pina<iwalkalone69@gmail.com>
+ * Authors: Marc Pina<iwalkalone69@gmail.com>
+ *          Claudi Martinez<claudix.kernel@gmail.com>
  */
 (function ($) {
     'use strict';
 
     $.fn.bootstrapTable.locales['ca-ES'] = {
         formatLoadingMessage: function () {
-            return 'Si us plau esperi...';
+            return 'Espereu, si us plau...';
         },
         formatRecordsPerPage: function (pageNumber) {
             return pageNumber + ' resultats per pàgina';
@@ -16,19 +17,19 @@
             return 'Mostrant de ' + pageFrom + ' fins ' + pageTo + ' - total ' + totalRows + ' resultats';
         },
         formatSearch: function () {
-            return 'Buscar';
+            return 'Cerca';
         },
         formatNoMatches: function () {
             return 'No s\'han trobat resultats';
         },
         formatPaginationSwitch: function () {
-            return 'Amagar/Mostrar paginació';
+            return 'Amaga/Mostra paginació';
         },
         formatRefresh: function () {
-            return 'Refrescar';
+            return 'Refresca';
         },
         formatToggle: function () {
-            return 'Amagar/Mostrar';
+            return 'Alterna formatació';
         },
         formatColumns: function () {
             return 'Columnes';

ファイルの差分が大きいため隠しています
+ 3 - 3
dist/locale/bootstrap-table-ca-ES.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-cs-CZ.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-da-DK.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-de-DE.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-el-GR.min.js


+ 2 - 2
dist/locale/bootstrap-table-en-US.js

@@ -10,7 +10,7 @@
             return 'Loading, please wait...';
         },
         formatRecordsPerPage: function (pageNumber) {
-            return pageNumber + ' records per page';
+            return pageNumber + ' rows per page';
         },
         formatShowingRows: function (pageFrom, pageTo, totalRows) {
             return 'Showing ' + pageFrom + ' to ' + pageTo + ' of ' + totalRows + ' rows';
@@ -40,4 +40,4 @@
 
     $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['en-US']);
 
-})(jQuery);
+})(jQuery);

ファイルの差分が大きいため隠しています
+ 3 - 3
dist/locale/bootstrap-table-en-US.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-es-AR.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-es-CR.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-es-ES.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-es-MX.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-es-NI.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-es-SP.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-et-EE.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-fa-IR.min.js


+ 2 - 2
dist/locale/bootstrap-table-fr-BE.min.js

@@ -1,7 +1,7 @@
 /*
-* bootstrap-table - v1.9.1 - 2015-10-25
+* bootstrap-table - v1.10.0 - 2016-01-18
 * https://github.com/wenzhixin/bootstrap-table
-* Copyright (c) 2015 zhixin wen
+* Copyright (c) 2016 zhixin wen
 * Licensed MIT License
 */
 !function(a){"use strict";a.fn.bootstrapTable.locales["fr-BE"]={formatLoadingMessage:function(){return"Chargement en cours..."},formatRecordsPerPage:function(a){return a+" entrées par page"},formatShowingRows:function(a,b,c){return"Affiche de"+a+" à "+b+" sur "+c+" lignes"},formatSearch:function(){return"Recherche"},formatNoMatches:function(){return"Pas de fichiers trouvés"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["fr-BE"])}(jQuery);

ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-fr-FR.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-hr-HR.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-hu-HU.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-it-IT.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-ja-JP.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-ka-GE.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-ko-KR.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-ms-MY.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-nb-NO.min.js


+ 3 - 3
dist/locale/bootstrap-table-nl-NL.js

@@ -13,12 +13,12 @@
             return pageNumber + ' records per pagina';
         },
         formatShowingRows: function (pageFrom, pageTo, totalRows) {
-            return 'Toon ' + pageFrom + ' tot ' + pageTo + ' van ' + totalRows + ' record' + ((totalRows > 1) ? "s" : "");
+            return 'Toon ' + pageFrom + ' tot ' + pageTo + ' van ' + totalRows + ' record' + ((totalRows > 1) ? 's' : '');
         },
         formatDetailPagination: function (totalRows) {
-            return 'Toon ' + totalRows + ' record' + ((totalRows > 1) ? "s" : "");
+            return 'Toon ' + totalRows + ' record' + ((totalRows > 1) ? 's' : '');
         },
-		formatSearch: function () {
+        formatSearch: function () {
             return 'Zoeken';
         },
         formatNoMatches: function () {

ファイルの差分が大きいため隠しています
+ 3 - 3
dist/locale/bootstrap-table-nl-NL.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-pl-PL.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-pt-BR.min.js


+ 2 - 2
dist/locale/bootstrap-table-pt-PT.min.js

@@ -1,7 +1,7 @@
 /*
-* bootstrap-table - v1.9.1 - 2015-10-25
+* bootstrap-table - v1.10.0 - 2016-01-18
 * https://github.com/wenzhixin/bootstrap-table
-* Copyright (c) 2015 zhixin wen
+* Copyright (c) 2016 zhixin wen
 * Licensed MIT License
 */
 !function(a){"use strict";a.fn.bootstrapTable.locales["pt-PT"]={formatLoadingMessage:function(){return"A carregar, aguarde..."},formatRecordsPerPage:function(a){return a+" registos por página"},formatShowingRows:function(a,b,c){return"A mostrar "+a+" até "+b+" de "+c+" linhas"},formatSearch:function(){return"Pesquisa"},formatNoMatches:function(){return"Nenhum registo encontrado"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["pt-PT"])}(jQuery);

ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-ro-RO.min.js


+ 3 - 0
dist/locale/bootstrap-table-ru-RU.js

@@ -28,6 +28,9 @@
         },
         formatColumns: function () {
             return 'Колонки';
+        },
+        formatClearFilters: function () {
+            return 'Очистить фильтры';
         }
     };
 

ファイルの差分が大きいため隠しています
+ 3 - 3
dist/locale/bootstrap-table-ru-RU.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-sk-SK.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-sv-SE.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-th-TH.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-tr-TR.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-uk-UA.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-ur-PK.min.js


+ 2 - 2
dist/locale/bootstrap-table-vi-VN.min.js

@@ -1,7 +1,7 @@
 /*
-* bootstrap-table - v1.9.1 - 2015-10-25
+* bootstrap-table - v1.10.0 - 2016-01-18
 * https://github.com/wenzhixin/bootstrap-table
-* Copyright (c) 2015 zhixin wen
+* Copyright (c) 2016 zhixin wen
 * Licensed MIT License
 */
 !function(a){"use strict";a.fn.bootstrapTable.locales["vi-VN"]={formatLoadingMessage:function(){return"Đang tải..."},formatRecordsPerPage:function(a){return a+" bản ghi mỗi trang"},formatShowingRows:function(a,b,c){return"Hiển thị từ trang "+a+" đến "+b+" của "+c+" bảng ghi"},formatSearch:function(){return"Tìm kiếm"},formatNoMatches:function(){return"Không có dữ liệu"}},a.extend(a.fn.bootstrapTable.defaults,a.fn.bootstrapTable.locales["vi-VN"])}(jQuery);

ファイルの差分が大きいため隠しています
+ 2 - 2
dist/locale/bootstrap-table-zh-CN.min.js


+ 2 - 2
dist/locale/bootstrap-table-zh-TW.js

@@ -19,13 +19,13 @@
             return '搜尋';
         },
         formatNoMatches: function () {
-            return '沒有找符合的結果';
+            return '沒有找符合的結果';
         },
         formatPaginationSwitch: function () {
             return '隱藏/顯示分頁';
         },
         formatRefresh: function () {
-            return '刷新';
+            return '重新整理';
         },
         formatToggle: function () {
             return '切換';

ファイルの差分が大きいため隠しています
+ 3 - 3
dist/locale/bootstrap-table-zh-TW.min.js


+ 30 - 10
docs/dist/bootstrap-table-locale-all.js

@@ -82,14 +82,15 @@
 
 /**
  * Bootstrap Table Catalan translation
- * Author: Marc Pina<iwalkalone69@gmail.com>
+ * Authors: Marc Pina<iwalkalone69@gmail.com>
+ *          Claudi Martinez<claudix.kernel@gmail.com>
  */
 (function ($) {
     'use strict';
 
     $.fn.bootstrapTable.locales['ca-ES'] = {
         formatLoadingMessage: function () {
-            return 'Si us plau esperi...';
+            return 'Espereu, si us plau...';
         },
         formatRecordsPerPage: function (pageNumber) {
             return pageNumber + ' resultats per pàgina';
@@ -98,19 +99,19 @@
             return 'Mostrant de ' + pageFrom + ' fins ' + pageTo + ' - total ' + totalRows + ' resultats';
         },
         formatSearch: function () {
-            return 'Buscar';
+            return 'Cerca';
         },
         formatNoMatches: function () {
             return 'No s\'han trobat resultats';
         },
         formatPaginationSwitch: function () {
-            return 'Amagar/Mostrar paginació';
+            return 'Amaga/Mostra paginació';
         },
         formatRefresh: function () {
-            return 'Refrescar';
+            return 'Refresca';
         },
         formatToggle: function () {
-            return 'Amagar/Mostrar';
+            return 'Alterna formatació';
         },
         formatColumns: function () {
             return 'Columnes';
@@ -285,7 +286,7 @@
             return 'Loading, please wait...';
         },
         formatRecordsPerPage: function (pageNumber) {
-            return pageNumber + ' records per page';
+            return pageNumber + ' rows per page';
         },
         formatShowingRows: function (pageFrom, pageTo, totalRows) {
             return 'Showing ' + pageFrom + ' to ' + pageTo + ' of ' + totalRows + ' rows';
@@ -316,6 +317,7 @@
     $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['en-US']);
 
 })(jQuery);
+
 /**
  * Bootstrap Table Spanish (Argentina) translation
  * Author: Felix Vera (felix.vera@gmail.com)
@@ -1048,13 +1050,28 @@
             return pageNumber + ' records per pagina';
         },
         formatShowingRows: function (pageFrom, pageTo, totalRows) {
-            return 'Toon ' + pageFrom + ' tot ' + pageTo + ' van ' + totalRows + ' records';
+            return 'Toon ' + pageFrom + ' tot ' + pageTo + ' van ' + totalRows + ' record' + ((totalRows > 1) ? 's' : '');
+        },
+        formatDetailPagination: function (totalRows) {
+            return 'Toon ' + totalRows + ' record' + ((totalRows > 1) ? 's' : '');
         },
         formatSearch: function () {
             return 'Zoeken';
         },
         formatNoMatches: function () {
             return 'Geen resultaten gevonden';
+        },
+        formatRefresh: function () {
+           return 'Vernieuwen';
+        },
+        formatToggle: function () {
+          return 'Omschakelen';
+        },
+        formatColumns: function () {
+          return 'Kolommen';
+        },
+        formatAllRows: function () {
+          return 'Alle';
         }
     };
 
@@ -1244,6 +1261,9 @@
         },
         formatColumns: function () {
             return 'Колонки';
+        },
+        formatClearFilters: function () {
+            return 'Очистить фильтры';
         }
     };
 
@@ -1571,13 +1591,13 @@
             return '搜尋';
         },
         formatNoMatches: function () {
-            return '沒有找符合的結果';
+            return '沒有找符合的結果';
         },
         formatPaginationSwitch: function () {
             return '隱藏/顯示分頁';
         },
         formatRefresh: function () {
-            return '刷新';
+            return '重新整理';
         },
         formatToggle: function () {
             return '切換';

ファイルの差分が大きいため隠しています
+ 3 - 3
docs/dist/bootstrap-table-locale-all.min.js


+ 3 - 2
docs/dist/bootstrap-table.css

@@ -1,6 +1,6 @@
 /**
  * @author zhixin wen <wenzhixin2010@gmail.com>
- * version: 1.8.1
+ * version: 1.10.0
  * https://github.com/wenzhixin/bootstrap-table/
  */
 
@@ -17,7 +17,7 @@
 .bootstrap-table .table:not(.table-condensed) > thead > tr > td,
 .bootstrap-table .table:not(.table-condensed) > tbody > tr > td,
 .bootstrap-table .table:not(.table-condensed) > tfoot > tr > td {
-    padding: 8px !important;
+    padding: 8px;
 }
 
 .bootstrap-table .table.table-no-bordered > thead > tr > th,
@@ -274,6 +274,7 @@
 .bootstrap-table .fixed-table-footer .table {
     border-bottom: none;
     border-radius: 0;
+    padding: 0 !important;
 }
 
 .pull-right .dropdown-menu {

+ 158 - 54
docs/dist/bootstrap-table.js

@@ -1,6 +1,6 @@
 /**
  * @author zhixin wen <wenzhixin2010@gmail.com>
- * version: 1.9.1
+ * version: 1.10.0
  * https://github.com/wenzhixin/bootstrap-table/
  */
 
@@ -180,11 +180,12 @@
     var escapeHTML = function (text) {
         if (typeof text === 'string') {
             return text
-                .replace(/&/g, "&amp;")
-                .replace(/</g, "&lt;")
-                .replace(/>/g, "&gt;")
-                .replace(/"/g, "&quot;")
-                .replace(/'/g, "&#039;");
+                .replace(/&/g, '&amp;')
+                .replace(/</g, '&lt;')
+                .replace(/>/g, '&gt;')
+                .replace(/"/g, '&quot;')
+                .replace(/'/g, '&#039;')
+                .replace(/`/g, '&#x60;');
         }
         return text;
     };
@@ -211,17 +212,21 @@
         return dataAttr;
     };
 
-    var getItemField = function (item, field) {
+    var getItemField = function (item, field, escape) {
         var value = item;
 
         if (typeof field !== 'string' || item.hasOwnProperty(field)) {
-            return item[field];
+            return escape ? escapeHTML(item[field]) : item[field];
         }
         var props = field.split('.');
         for (var p in props) {
-            value = value[props[p]];
+            value = value && value[props[p]];
         }
-        return value;
+        return escape ? escapeHTML(value) : value;
+    };
+
+    var isIEBrowser = function () {
+        return !!(navigator.userAgent.indexOf("MSIE ") > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./));
     };
 
     // BOOTSTRAP TABLE CLASS DEFINITION
@@ -272,11 +277,10 @@
         paginationHAlign: 'right', //right, left
         paginationVAlign: 'bottom', //bottom, top, both
         paginationDetailHAlign: 'left', //right, left
-        paginationFirstText: '&laquo;',
         paginationPreText: '&lsaquo;',
         paginationNextText: '&rsaquo;',
-        paginationLastText: '&raquo;',
         search: false,
+        searchOnEnterKey: false,
         strictSearch: false,
         searchAlign: 'right',
         selectItemName: 'btSelectItem',
@@ -288,6 +292,7 @@
         showToggle: false,
         buttonsAlign: 'right',
         smartDisplay: true,
+        escape: true,
         minimumCountColumns: 1,
         idField: undefined,
         uniqueId: undefined,
@@ -619,7 +624,7 @@
         });
 
         // if options.data is setting, do not process tbody data
-        if (this.options.data.length) {
+        if (this.options.data) {
             return;
         }
 
@@ -763,7 +768,11 @@
             $(this).data(visibleColumns[$(this).data('field')]);
         });
         this.$container.off('click', '.th-inner').on('click', '.th-inner', function (event) {
-            if (that.options.sortable && $(this).parent().data().sortable) {
+            var target = $(this);
+            if (target.closest('.bootstrap-table')[0] !== that.$container[0])
+                return false;
+
+            if (that.options.sortable && target.parent().data().sortable) {
                 that.onSort(event);
             }
         });
@@ -790,8 +799,7 @@
         }
 
         this.$selectAll = this.$header.find('[name="btSelectAll"]');
-        this.$container.off('click', '[name="btSelectAll"]')
-            .on('click', '[name="btSelectAll"]', function () {
+        this.$selectAll.off('click').on('click', function () {
                 var checked = $(this).prop('checked');
                 that[checked ? 'checkAll' : 'uncheckAll']();
                 that.updateSelected();
@@ -845,8 +853,8 @@
                 if (that.header.sortNames[index]) {
                     name = that.header.sortNames[index];
                 }
-                var aa = getItemField(a, name),
-                    bb = getItemField(b, name),
+                var aa = getItemField(a, name, that.options.escape),
+                    bb = getItemField(b, name, that.options.escape),
                     value = calculateObjectValue(that.header, that.header.sorters[index], [aa, bb]);
 
                 if (value !== undefined) {
@@ -926,6 +934,9 @@
             $search,
             switchableCount = 0;
 
+        if (this.$toolbar.find('.bars').children().length) {
+            $('body').append($(this.options.toolbar));
+        }
         this.$toolbar.html('');
 
         if (typeof this.options.toolbar === 'string' || typeof this.options.toolbar === 'object') {
@@ -1002,7 +1013,7 @@
 
         html.push('</div>');
 
-        // Fix #188: this.showToolbar is for extentions
+        // Fix #188: this.showToolbar is for extensions
         if (this.showToolbar || html.length > 2) {
             this.$toolbar.append(html.join(''));
         }
@@ -1056,11 +1067,26 @@
             this.$toolbar.append(html.join(''));
             $search = this.$toolbar.find('.search input');
             $search.off('keyup drop').on('keyup drop', function (event) {
+                if (that.options.searchOnEnterKey) {
+                    if (event.keyCode !== 13) {
+                        return;
+                    }
+                }
+
                 clearTimeout(timeoutId); // doesn't matter if it's 0
                 timeoutId = setTimeout(function () {
                     that.onSearch(event);
                 }, that.options.searchTimeOut);
             });
+
+            if (isIEBrowser()) {
+                $search.off('mouseup').on('mouseup', function (event) {
+                    clearTimeout(timeoutId); // doesn't matter if it's 0
+                    timeoutId = setTimeout(function () {
+                        that.onSearch(event);
+                    }, that.options.searchTimeOut);
+                });
+            }
         }
     };
 
@@ -1076,6 +1102,7 @@
             return;
         }
         this.searchText = text;
+        this.options.searchText = text;
 
         this.options.pageNumber = 1;
         this.initSearch();
@@ -1111,7 +1138,7 @@
                         column = that.columns[getFieldIndex(that.columns, key)],
                         j = $.inArray(key, that.header.fields);
 
-                    // Fix #142: search use formated data
+                    // Fix #142: search use formatted data
                     if (column && column.searchFormatter) {
                         value = calculateObjectValue(column,
                             that.header.formatters[j], [value, item, i], value);
@@ -1243,7 +1270,6 @@
             html.push('</div>',
                 '<div class="pull-' + this.options.paginationHAlign + ' pagination">',
                 '<ul class="pagination' + sprintf(' pagination-%s', this.options.iconSize) + '">',
-                '<li class="page-first"><a href="javascript:void(0)">' + this.options.paginationFirstText + '</a></li>',
                 '<li class="page-pre"><a href="javascript:void(0)">' + this.options.paginationPreText + '</a></li>');
 
             if (this.totalPages < 5) {
@@ -1261,18 +1287,71 @@
                     from = to - 4;
                 }
             }
+
+            if (this.totalPages >= 6) {
+                if (this.options.pageNumber >= 3) {
+                    html.push('<li class="page-first' + (1 === this.options.pageNumber ? ' active' : '') + '">',
+                        '<a href="javascript:void(0)">', 1, '</a>',
+                        '</li>');
+
+                    from++;
+                }
+
+                if (this.options.pageNumber >= 4) {
+                    if (this.options.pageNumber == 4 || this.totalPages == 6 || this.totalPages == 7) {
+                        from--;
+                    } else {
+                        html.push('<li class="page-first-separator disabled">',
+                            '<a href="javascript:void(0)">...</a>',
+                            '</li>');
+                    }
+
+                    to--;
+                }
+            }
+
+            if (this.totalPages >= 7) {
+                if (this.options.pageNumber >= (this.totalPages - 2)) {
+                    from--;
+                }
+            }
+
+            if (this.totalPages == 6) {
+                if (this.options.pageNumber >= (this.totalPages - 2)) {
+                    to++;
+                }
+            } else if (this.totalPages >= 7) {
+                if (this.totalPages == 7 || this.options.pageNumber >= (this.totalPages - 3)) {
+                    to++;
+                }
+            }
+
             for (i = from; i <= to; i++) {
                 html.push('<li class="page-number' + (i === this.options.pageNumber ? ' active' : '') + '">',
                     '<a href="javascript:void(0)">', i, '</a>',
                     '</li>');
             }
 
+            if (this.totalPages >= 8) {
+                if (this.options.pageNumber <= (this.totalPages - 4)) {
+                    html.push('<li class="page-last-separator disabled">',
+                        '<a href="javascript:void(0)">...</a>',
+                        '</li>');
+                }
+            }
+
+            if (this.totalPages >= 6) {
+                if (this.options.pageNumber <= (this.totalPages - 3)) {
+                    html.push('<li class="page-last' + (this.totalPages === this.options.pageNumber ? ' active' : '') + '">',
+                        '<a href="javascript:void(0)">', this.totalPages, '</a>',
+                        '</li>');
+                }
+            }
+
             html.push(
                 '<li class="page-next"><a href="javascript:void(0)">' + this.options.paginationNextText + '</a></li>',
-                '<li class="page-last"><a href="javascript:void(0)">' + this.options.paginationLastText + '</a></li>',
                 '</ul>',
                 '</div>');
-
         }
         this.$pagination.html(html.join(''));
 
@@ -1284,14 +1363,6 @@
             $last = this.$pagination.find('.page-last');
             $number = this.$pagination.find('.page-number');
 
-            if (this.options.pageNumber <= 1) {
-                $first.addClass('disabled');
-                $pre.addClass('disabled');
-            }
-            if (this.options.pageNumber >= this.totalPages) {
-                $next.addClass('disabled');
-                $last.addClass('disabled');
-            }
             if (this.options.smartDisplay) {
                 if (this.totalPages <= 1) {
                     this.$pagination.find('div.pagination').hide();
@@ -1352,12 +1423,20 @@
     };
 
     BootstrapTable.prototype.onPagePre = function (event) {
-        this.options.pageNumber--;
+        if ((this.options.pageNumber - 1) == 0) {
+            this.options.pageNumber = this.options.totalPages;
+        } else {
+            this.options.pageNumber--;
+        }
         this.updatePagination(event);
     };
 
     BootstrapTable.prototype.onPageNext = function (event) {
-        this.options.pageNumber++;
+        if ((this.options.pageNumber + 1) > this.options.totalPages) {
+            this.options.pageNumber = 1;
+        } else {
+            this.options.pageNumber++;
+        }
         this.updatePagination(event);
     };
 
@@ -1453,7 +1532,7 @@
 
             $.each(this.header.fields, function (j, field) {
                 var text = '',
-                    value = getItemField(item, field),
+                    value = getItemField(item, field, that.options.escape),
                     type = '',
                     cellStyle = {},
                     id_ = '',
@@ -1512,8 +1591,8 @@
                     type = column.checkbox ? 'checkbox' : type;
                     type = column.radio ? 'radio' : type;
 
-                    text = [that.options.cardView ?
-                        '<div class="card-view">' : '<td class="bs-checkbox">',
+                    text = [sprintf(that.options.cardView ?
+                        '<div class="card-view %s">' : '<td class="bs-checkbox %s">', column['class'] || ''),
                         '<input' +
                         sprintf(' data-index="%s"', i) +
                         sprintf(' name="%s"', that.options.selectItemName) +
@@ -1582,7 +1661,7 @@
                 index = $td[0].cellIndex,
                 field = that.header.fields[that.options.detailView && !that.options.cardView ? index - 1 : index],
                 column = that.columns[getFieldIndex(that.columns, field)],
-                value = getItemField(item, field);
+                value = getItemField(item, field, that.options.escape);
 
             if ($td.find('.detail-icon').length) {
                 return;
@@ -1613,10 +1692,13 @@
                 that.trigger('collapse-row', index, row);
             } else {
                 $this.find('i').attr('class', sprintf('%s %s', that.options.iconsPrefix, that.options.icons.detailClose));
-                $tr.after(sprintf('<tr class="detail-view"><td colspan="%s">%s</td></tr>',
-                    $tr.find('td').length, calculateObjectValue(that.options,
-                        that.options.detailFormatter, [index, row], '')));
-                that.trigger('expand-row', index, row, $tr.next().find('td'));
+                $tr.after(sprintf('<tr class="detail-view"><td colspan="%s"></td></tr>', $tr.find('td').length));
+                var $element = $tr.next().find('td');
+                var content = calculateObjectValue(that.options, that.options.detailFormatter, [index, row, $element], '');
+                if($element.length === 1) {
+                    $element.append(content);
+                }
+                that.trigger('expand-row', index, row, $element);
             }
             that.resetView();
         });
@@ -1694,15 +1776,18 @@
         var that = this,
             data = {},
             params = {
-                pageSize: this.options.pageSize === this.options.formatAllRows() ?
-                    this.options.totalRows : this.options.pageSize,
-                pageNumber: this.options.pageNumber,
                 searchText: this.searchText,
                 sortName: this.options.sortName,
                 sortOrder: this.options.sortOrder
             },
             request;
 
+        if(this.options.pagination) {
+            params.pageSize = this.options.pageSize === this.options.formatAllRows() ?
+                this.options.totalRows : this.options.pageSize;
+            params.pageNumber = this.options.pageNumber;
+        }
+
         if (!this.options.url && !this.options.ajax) {
             return;
         }
@@ -1750,14 +1835,11 @@
 
                 that.load(res);
                 that.trigger('load-success', res);
+                if (!silent) that.$tableLoading.hide();
             },
             error: function (res) {
                 that.trigger('load-error', res.status, res);
-            },
-            complete: function () {
-                if (!silent) {
-                    that.$tableLoading.hide();
-                }
+                if (!silent) that.$tableLoading.hide();
             }
         });
 
@@ -2120,6 +2202,7 @@
         this.initData(data, 'append');
         this.initSearch();
         this.initPagination();
+        this.initSort();
         this.initBody(true);
     };
 
@@ -2127,6 +2210,7 @@
         this.initData(data, 'prepend');
         this.initSearch();
         this.initPagination();
+        this.initSort();
         this.initBody(true);
     };
 
@@ -2155,6 +2239,7 @@
 
         this.initSearch();
         this.initPagination();
+        this.initSort();
         this.initBody(true);
     };
 
@@ -2259,14 +2344,14 @@
     };
 
     BootstrapTable.prototype.showRow = function (params) {
-        if (!params.hasOwnProperty('index') || !params.hasOwnProperty('uniqueId')) {
+        if (!params.hasOwnProperty('index') && !params.hasOwnProperty('uniqueId')) {
             return;
         }
         this.toggleRow(params.index, params.uniqueId, true);
     };
 
     BootstrapTable.prototype.hideRow = function (params) {
-        if (!params.hasOwnProperty('index') || !params.hasOwnProperty('uniqueId')) {
+        if (!params.hasOwnProperty('index') && !params.hasOwnProperty('uniqueId')) {
             return;
         }
         this.toggleRow(params.index, params.uniqueId, false);
@@ -2318,6 +2403,10 @@
             return;
         }
         this.data[params.index][params.field] = params.value;
+
+        if (params.reinit === false) {
+            return;
+        }
         this.initSort();
         this.initBody(true);
     };
@@ -2525,7 +2614,7 @@
 
     BootstrapTable.prototype.refreshOptions = function (options) {
         //If the objects are equivalent then avoid the call of destroy / init methods
-        if (compareObjects(this.options, options, false)) {
+        if (compareObjects(this.options, options, true)) {
             return;
         }
         this.options = $.extend(this.options, options);
@@ -2604,6 +2693,21 @@
         }
     };
 
+    BootstrapTable.prototype.updateFormatText = function (name, text) {
+        if (this.options[sprintf('format%s', name)]) {
+            if (typeof text === 'string') {
+                this.options[sprintf('format%s', name)] = function () {
+                    return text;
+                };
+            } else if (typeof text === 'function') {
+                this.options[sprintf('format%s', name)] = text;
+            }
+        }
+        this.initToolbar();
+        this.initPagination();
+        this.initBody();
+    };
+
     // BOOTSTRAP TABLE PLUGIN DEFINITION
     // =======================
 
@@ -2631,7 +2735,8 @@
         'toggleView',
         'refreshOptions',
         'resetSearch',
-        'expandRow', 'collapseRow', 'expandAllRows', 'collapseAllRows'
+        'expandRow', 'collapseRow', 'expandAllRows', 'collapseAllRows',
+        'updateFormatText'
     ];
 
     $.fn.bootstrapTable = function (option) {
@@ -2686,5 +2791,4 @@
     $(function () {
         $('[data-toggle="table"]').bootstrapTable();
     });
-
 }(jQuery);

ファイルの差分が大きいため隠しています
+ 1 - 1
docs/dist/bootstrap-table.min.css


ファイルの差分が大きいため隠しています
+ 4 - 5
docs/dist/bootstrap-table.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
docs/dist/extensions/accent-neutralise/bootstrap-table-accent-neutralise.min.js


ファイルの差分が大きいため隠しています
+ 2 - 2
docs/dist/extensions/angular/bootstrap-table-angular.min.js


+ 8 - 4
docs/dist/extensions/cookie/bootstrap-table-cookie.js

@@ -123,7 +123,7 @@
                 cookieExpire = cookieExpire * 30 * 24 * 60 * 60;
                 break;
             case 'y':
-                cookieExpire = cookieExpire * 365 * 30 * 24 * 60 * 60;
+                cookieExpire = cookieExpire * 365 * 24 * 60 * 60;
                 break;
             default:
                 cookieExpire = undefined;
@@ -203,7 +203,7 @@
                                 searchControls = getCurrentSearchControls(that);
 
                             header.find(searchControls).each(function (index, ele) {
-                                field = $(this).parent().parent().parent().data('field');
+                                field = $(this).closest('[data-field]').data('field');
                                 result = $.grep(filterControl, function (valueObj) {
                                     return valueObj.field === field;
                                 });
@@ -317,8 +317,12 @@
     };
 
     BootstrapTable.prototype.onSearch = function () {
-        _onSearch.apply(this, Array.prototype.slice.apply(arguments));
-        setCookie(this, cookieIds.searchText, this.searchText);
+        var target = Array.prototype.slice.apply(arguments);
+        _onSearch.apply(this, target);
+
+        if ($(target[0].currentTarget).parent().hasClass('search')) {
+          setCookie(this, cookieIds.searchText, this.searchText);
+        }
     };
 
     BootstrapTable.prototype.deleteCookie = function (cookieName) {

ファイルの差分が大きいため隠しています
+ 3 - 3
docs/dist/extensions/cookie/bootstrap-table-cookie.min.js


+ 21 - 0
docs/dist/extensions/editable/bootstrap-table-editable.js

@@ -47,14 +47,34 @@
                 return;
             }
 
+            var editableOptions = {}, editableDataMarkup = [], editableDataPrefix = 'editable-';
+
+            var processDataOptions = function(key, value) {
+              // Replace camel case with dashes.
+              var dashKey = key.replace(/([A-Z])/g, function($1){return "-"+$1.toLowerCase();});
+              if (dashKey.slice(0, editableDataPrefix.length) == editableDataPrefix) {
+                var dataKey = dashKey.replace(editableDataPrefix, 'data-');
+                editableOptions[dataKey] = value;
+              }
+            };
+
+            $.each(that.options, processDataOptions);
+
             var _formatter = column.formatter;
             column.formatter = function (value, row, index) {
                 var result = _formatter ? _formatter(value, row, index) : value;
 
+                $.each(column, processDataOptions);
+
+                $.each(editableOptions, function (key, value) {
+                    editableDataMarkup.push(' ' + key + '="' + value + '"');
+                });
+
                 return ['<a href="javascript:void(0)"',
                     ' data-name="' + column.field + '"',
                     ' data-pk="' + row[that.options.idField] + '"',
                     ' data-value="' + result + '"',
+                    editableDataMarkup.join(''),
                     '>' + '</a>'
                 ].join('');
             };
@@ -81,6 +101,7 @@
                         row = data[index],
                         oldValue = row[column.field];
 
+                    $(this).data('value', params.submitValue);
                     row[column.field] = params.submitValue;
                     that.trigger('editable-save', column.field, row, oldValue, $(this));
                 });

ファイルの差分が大きいため隠しています
+ 3 - 3
docs/dist/extensions/editable/bootstrap-table-editable.min.js


+ 9 - 2
docs/dist/extensions/export/bootstrap-table-export.js

@@ -5,6 +5,7 @@
 
 (function ($) {
     'use strict';
+    var sprintf = $.fn.bootstrapTable.utils.sprintf;
 
     var TYPE_NAME = {
         json: 'JSON',
@@ -27,6 +28,10 @@
         exportOptions: {}
     });
 
+    $.extend($.fn.bootstrapTable.defaults.icons, {
+        export: 'glyphicon-export icon-share'
+    });
+
     var BootstrapTable = $.fn.bootstrapTable.Constructor,
         _initToolbar = BootstrapTable.prototype.initToolbar;
 
@@ -43,9 +48,11 @@
             if (!$export.length) {
                 $export = $([
                     '<div class="export btn-group">',
-                        '<button class="btn btn-default dropdown-toggle" ' +
+                        '<button class="btn btn-default' +
+                            sprintf(' btn-%s', this.options.iconSize) +
+                            ' dropdown-toggle" ' +
                             'data-toggle="dropdown" type="button">',
-                            '<i class="glyphicon glyphicon-export icon-share"></i> ',
+                            sprintf('<i class="%s %s"></i> ', this.options.iconsPrefix, this.options.icons.export),
                             '<span class="caret"></span>',
                         '</button>',
                         '<ul class="dropdown-menu" role="menu">',

ファイルの差分が大きいため隠しています
+ 3 - 3
docs/dist/extensions/export/bootstrap-table-export.min.js


+ 127 - 46
docs/dist/extensions/filter-control/bootstrap-table-filter-control.js

@@ -11,8 +11,9 @@
     var sprintf = $.fn.bootstrapTable.utils.sprintf;
 
     var addOptionToSelectControl = function (selectControl, value, text) {
+        value = $.trim(value);
         selectControl = $(selectControl.get(selectControl.length - 1));
-        if (existsOptionInSelectControl(selectControl, value)) {
+        if (existOptionInSelectControl(selectControl, value)) {
             selectControl.append($("<option></option>")
                 .attr("value", value)
                 .text($('<div />').html(text).text()));
@@ -35,11 +36,11 @@
         }
     };
 
-    var existsOptionInSelectControl = function (selectControl, value) {
+    var existOptionInSelectControl = function (selectControl, value) {
         var options = selectControl.get(selectControl.length - 1).options;
         for (var i = 0; i < options.length; i++) {
             if (options[i].value === value.toString()) {
-                //The value is nor valid to add
+                //The value is not valid to add
                 return false;
             }
         }
@@ -74,12 +75,12 @@
         var header = getCurrentHeader(that),
             searchControls = getCurrentSearchControls(that);
 
-        that.options.values = [];
+        that.options.valuesFilterControl = [];
 
         header.find(searchControls).each(function () {
-            that.options.values.push(
+            that.options.valuesFilterControl.push(
                 {
-                    field: $(this).parent().parent().parent().data('field'),
+                    field: $(this).closest('[data-field]').data('field'),
                     value: $(this).val()
                 });
         });
@@ -91,10 +92,10 @@
             header = getCurrentHeader(that),
             searchControls = getCurrentSearchControls(that);
 
-        if (that.options.values.length > 0) {
+        if (that.options.valuesFilterControl.length > 0) {
             header.find(searchControls).each(function (index, ele) {
-                field = $(this).parent().parent().parent().data('field');
-                result = $.grep(that.options.values, function (valueObj) {
+                field = $(this).closest('[data-field]').data('field');
+                result = $.grep(that.options.valuesFilterControl, function (valueObj) {
                     return valueObj.field === field;
                 });
 
@@ -105,6 +106,24 @@
         }
     };
 
+    var collectBootstrapCookies = function cookiesRegex() {
+        var cookies = [],
+            foundCookies = document.cookie.match(/(?:bs.table.)(\w*)/g);
+
+        if (foundCookies) {
+            $.each(foundCookies, function (i, cookie) {
+                if (/./.test(cookie)) {
+                    cookie = cookie.split(".").pop();
+                }
+
+                if ($.inArray(cookie, cookies) === -1) {
+                    cookies.push(cookie);
+                }
+            });
+            return cookies;
+        }
+    };
+
     var createControls = function (that, header) {
         var addedFilterControl = false,
             isVisible,
@@ -122,24 +141,13 @@
             if (!column.filterControl) {
                 html.push('<div style="height: 34px;"></div>');
             } else {
-                html.push('<div style="margin: 0px 2px 2px 2px;" class="filterControl">');
+                html.push('<div style="margin: 0 2px 2px 2px;" class="filterControl">');
 
-                if (column.filterControl && column.searchable) {
+                var nameControl = column.filterControl.toLowerCase();
+                if (column.searchable && that.options.filterTemplate[nameControl]) {
                     addedFilterControl = true;
-                    isVisible = 'visible'
-                }
-                switch (column.filterControl.toLowerCase()) {
-                    case 'input' :
-                        html.push(sprintf('<input type="text" class="form-control" style="width: 100%; visibility: %s">', isVisible));
-                        break;
-                    case 'select':
-                        html.push(sprintf('<select class="%s form-control" style="width: 100%; visibility: %s"></select>',
-                            column.field, isVisible))
-                        break;
-                    case 'datepicker':
-                        html.push(sprintf('<input type="text" class="date-filter-control %s form-control" style="width: 100%; visibility: %s">',
-                            column.field, isVisible));
-                        break;
+                    isVisible = 'visible';
+                    html.push(that.options.filterTemplate[nameControl](that, column.field, isVisible));
                 }
             }
 
@@ -229,14 +237,42 @@
         }
     };
 
+    var getDirectionOfSelectOptions = function (alignment) {
+        alignment = alignment === undefined ? 'left' : alignment.toLowerCase();
+
+        switch (alignment) {
+            case 'left':
+                return 'ltr';
+            case 'right':
+                return 'rtl';
+            case 'auto':
+                return 'auto';
+            default:
+                return 'ltr'
+        }
+    };
+
     $.extend($.fn.bootstrapTable.defaults, {
         filterControl: false,
         onColumnSearch: function (field, text) {
             return false;
         },
         filterShowClear: false,
+        alignmentSelectControlOptions: undefined,
         //internal variables
-        values: []
+        valuesFilterControl: [],
+        filterTemplate: {
+            input: function (that, field, isVisible) {
+                return sprintf('<input type="text" class="form-control %s" style="width: 100%; visibility: %s">', field, isVisible);
+            },
+            select: function (that, field, isVisible) {
+                return sprintf('<select class="%s form-control" style="width: 100%; visibility: %s" dir="%s"></select>',
+                    field, isVisible, getDirectionOfSelectOptions(that.options.alignmentSelectControlOptions))
+            },
+            datepicker: function (that, field, isVisible) {
+                return sprintf('<input type="text" class="date-filter-control %s form-control" style="width: 100%; visibility: %s">', field, isVisible);
+            }
+        }
     });
 
     $.extend($.fn.bootstrapTable.COLUMN_DEFAULTS, {
@@ -250,6 +286,10 @@
         'column-search.bs.table': 'onColumnSearch'
     });
 
+    $.extend($.fn.bootstrapTable.defaults.icons, {
+        clear: 'glyphicon-trash icon-clear'
+    });
+
     var BootstrapTable = $.fn.bootstrapTable.Constructor,
         _init = BootstrapTable.prototype.init,
         _initToolbar = BootstrapTable.prototype.initToolbar,
@@ -258,11 +298,11 @@
         _initSearch = BootstrapTable.prototype.initSearch;
 
     BootstrapTable.prototype.init = function () {
-        //Make sure that the filtercontrol option is set
+        //Make sure that the filterControl option is set
         if (this.options.filterControl) {
             var that = this;
             //Make sure that the internal variables are set correctly
-            this.options.values = [];
+            this.options.valuesFilterControl = [];
 
             this.$el.on('reset-view.bs.table', function () {
                 //Create controls on $tableHeader if the height is set
@@ -282,13 +322,20 @@
                 if (that.options.height) {
                     fixHeaderCSS(that);
                 }
-            }).on('column-switch.bs.table', function(field, checked) {
+            }).on('column-switch.bs.table', function() {
                 setValues(that);
             });
         }
         _init.apply(this, Array.prototype.slice.apply(arguments));
     };
 
+    $.extend($.fn.bootstrapTable.locales, {
+        formatClearFilters: function () {
+            return 'Clear Filters';
+        }
+    });
+    $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales);
+
     BootstrapTable.prototype.initToolbar = function () {
         if ((!this.showToolbar) && (this.options.filterControl)) {
             this.showToolbar = this.options.filterControl;
@@ -302,9 +349,9 @@
 
             if (!$btnClear.length) {
               $btnClear = $([
-                    '<button class="btn btn-default " ' +
-                        'type="button">',
-                    '<i class="glyphicon glyphicon-trash icon-share"></i> ',
+                    '<button class="btn btn-default" ',
+                    sprintf('type="button" title="%s">', this.options.formatClearFilters()),
+                    sprintf('<i class="%s %s"></i> ', this.options.iconsPrefix, this.options.icons.clear),
                     '</button>',
                     '</ul>'].join('')).appendTo($btnGroup);
 
@@ -361,6 +408,10 @@
     BootstrapTable.prototype.initSearch = function () {
         _initSearch.apply(this, Array.prototype.slice.apply(arguments));
 
+        if (!this.options.sidePagination === 'server') {
+            return;
+        }
+
         var that = this;
         var fp = $.isEmptyObject(this.filterColumnsPartial) ? null : this.filterColumnsPartial;
 
@@ -370,24 +421,28 @@
                 var thisColumn = that.columns[$.fn.bootstrapTable.utils.getFieldIndex(that.columns, key)];
                 var fval = fp[key].toLowerCase();
                 var value = item[key];
-                value = $.fn.bootstrapTable.utils.calculateObjectValue(that.header,
+                
+                // Fix #142: search use formated data
+                if (thisColumn && thisColumn.searchFormatter) {
+                    value = $.fn.bootstrapTable.utils.calculateObjectValue(that.header,
                     that.header.formatters[$.inArray(key, that.header.fields)],
                     [value, item, i], value);
+                }
 
-                if(thisColumn.filterStrictSearch){
+                if (thisColumn.filterStrictSearch) {
                     if (!($.inArray(key, that.header.fields) !== -1 &&
                         (typeof value === 'string' || typeof value === 'number') &&
                         value.toString().toLowerCase() === fval.toString().toLowerCase())) {
                         return false;
                     }
                 }
-                else{
+                else {
                     if (!($.inArray(key, that.header.fields) !== -1 &&
                         (typeof value === 'string' || typeof value === 'number') &&
                         (value + '').toLowerCase().indexOf(fval) !== -1)) {
                         return false;
                     }
-                };
+                }
             }
             return true;
         }) : this.data;
@@ -396,7 +451,7 @@
     BootstrapTable.prototype.onColumnSearch = function (event) {
         copyValues(this);
         var text = $.trim($(event.currentTarget).val());
-        var $field = $(event.currentTarget).parent().parent().parent().data('field')
+        var $field = $(event.currentTarget).closest('[data-field]').data('field');
 
         if ($.isEmptyObject(this.filterColumnsPartial)) {
             this.filterColumnsPartial = {};
@@ -415,22 +470,48 @@
 
     BootstrapTable.prototype.clearFilterControl = function () {
         if (this.options.filterControl && this.options.filterShowClear) {
-            $.each(this.options.values, function (i, item) {
+            var that = this,
+                cookies = collectBootstrapCookies(),
+                header = getCurrentHeader(that),
+                table = header.closest('table'),
+                controls = header.find(getCurrentSearchControls(that)),
+                search = that.$toolbar.find('.search input'),
+                timeoutId = 0;
+
+            $.each(that.options.valuesFilterControl, function (i, item) {
                 item.value = '';
             });
 
-            setValues(this);
-
-            var controls = getCurrentHeader(this).find(getCurrentSearchControls(this)),
-                timeoutId = 0;
+            setValues(that);
 
+            // Clear each type of filter if it exists.
+            // Requires the body to reload each time a type of filter is found because we never know
+            // which ones are going to be present.
             if (controls.length > 0) {
                 this.filterColumnsPartial = {};
-                clearTimeout(timeoutId);
-                timeoutId = setTimeout(function () {
-                    $(controls[0]).trigger(controls[0].tagName === 'INPUT' ? 'keyup' : 'change');
-                }, this.options.searchTimeOut);
+                $(controls[0]).trigger(controls[0].tagName === 'INPUT' ? 'keyup' : 'change');
+            }
+
+            if (search.length > 0) {
+                that.resetSearch();
             }
+
+            // use the default sort order if it exists. do nothing if it does not
+            if (that.options.sortName !== table.data('sortName') || that.options.sortOrder !== table.data('sortOrder')) {
+                var sorter = sprintf(header.find('[data-field="%s"]', $(controls[0]).closest('table').data('sortName')));
+                that.onSort(table.data('sortName'), table.data('sortName'));
+                $(sorter).find('.sortable').trigger('click');
+            }
+
+            // clear cookies once the filters are clean
+            clearTimeout(timeoutId);
+            timeoutId = setTimeout(function () {
+                if (cookies && cookies.length > 0) {
+                    $.each(cookies, function (i, item) {
+                        that.deleteCookie(item);
+                    });
+                }
+            }, that.options.searchTimeOut);
         }
     };
 }(jQuery);

ファイルの差分が大きいため隠しています
+ 3 - 3
docs/dist/extensions/filter-control/bootstrap-table-filter-control.min.js


+ 0 - 0
docs/dist/extensions/filter/bootstrap-table-filter.min.js


この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません