Browse Source

Merge pull request #31 from wenzhixin/master

Update my repo
Dennis Hernández 10 years ago
parent
commit
b67a86a091

+ 9 - 0
.gitignore

@@ -1,4 +1,13 @@
 node_modules
+
+# docs site
 _gh_pages
+
+# deploy the docs
 deploy.sh
+
+# old docs
 docs_
+
+# check the locale file on README
+check.js

+ 6 - 2
CHANGELOG.md

@@ -6,9 +6,13 @@
 - [enh] Added state saving for visible columns and the ability to use extension with multiple simultaneous tables.
 - [enh] Added `ajax` option to replace jquery ajax method.
 - [enh] Added `resetWidth` method to reset header and footer width.
-- [enh] Added keyevents, mobile extensions.
-- [enh] Added `onToggle`, `onColumnSearch` events.
+- [enh] Added keyevents, mobile, filter control, reorder, naturalsorting extensions.
+- [enh] Added `onToggle` events.
 - [enh] Added `getScrollPosition` method.
+- [bug] Fix double header bug after table show from hidden.
+- [bug] Fix #279: scrollWidth bug.
+- [enh] `getData` method support to get the current page data.
+- [enh] Added `ro-RO` locale.
 
 ### 1.7.0
 

File diff suppressed because it is too large
+ 7 - 0
dist/locale/bootstrap-table-ro-RO.min.js


+ 0 - 17
docs/_i18n/en/extensions/README.md

@@ -1,17 +0,0 @@
-# Table Filter
-
-Use Plugin: [bootstrap table filters](https://github.com/lukaskral/bootstrap-table-filter)
-
-## Usage
-
-```html
-<script src="extensions/filter/bootstrap-table-filter.js"></script>
-```
-
-## Options
-
-### showFilter
-
-* type: Boolean
-* description: set true to show filter menu.
-* default: `false`

+ 31 - 0
docs/_i18n/en/extensions/filtercontrol.md

@@ -0,0 +1,31 @@
+# Table Filter Control
+
+Use Plugin: [bootstrap-table-filtercontrol](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/filtercontrol)
+
+## Usage
+
+```html
+<script src="extensions/filtercontrol/bootstrap-table-filtercontrol.js"></script>
+```
+
+## Options
+
+### filterControl
+
+* type: Boolean
+* description: Set true to add an `input` or `select` into the column.
+* default: `false`
+
+## Column options
+
+### filterControl
+
+* type: String
+* description: Set `input` or `select` to add one of those element into column.
+* default: `undefined`
+
+## Events
+
+### onColumnSearch(column-search.bs.table)
+
+* Fired when we are searching into the column data

+ 13 - 0
docs/_i18n/en/extensions/naturalsorting.md

@@ -0,0 +1,13 @@
+# Table Natural Sorting
+
+Use Plugin: [bootstrap-table-naturalsorting](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/naturalsorting)
+
+## Usage
+
+```html
+<script src="extensions/naturalsorting/bootstrap-table-naturalsorting.js"></script>
+```
+
+### Options
+
+* Just add data-sorter="alphanum" to any th

+ 35 - 0
docs/_i18n/en/extensions/reorder.md

@@ -0,0 +1,35 @@
+# Table Reorder
+
+Use Plugin: [bootstrap-table-reorder](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/reorder) </br>
+Dependence: [dragTable](https://github.com/akottr/dragtable/) v2.0.14 (must include the css file), </br>
+[jquery-ui](https://code.jquery.com/ui/) v1.11
+
+
+## Usage
+
+```html
+<link rel="stylesheet" href=".../dragtable.css">
+<script src=".../jquery-ui.js"></script>
+<script src=".../jquery.dragtable.js"></script>
+<script src="extensions/cookie/bootstrap-table-reorder.js"></script>
+```
+
+## Options
+
+### reorderable
+
+* type: Boolean
+* description: Set true to allow the reorder feature.
+* default: `false`
+
+### maxMovingRows
+
+* type: Integer
+* description: Moving only the header. Recommended for very large tables (cells > 1000)
+* default: `10`
+
+## Events
+
+### onReorder(reorder.bs.table)
+
+Fired when the column was dropped, receive as parameter the new header fields order

+ 0 - 17
docs/_i18n/es/extensions/README.md

@@ -1,17 +0,0 @@
-# Table Filter
-
-Use Plugin: [bootstrap table filters](https://github.com/lukaskral/bootstrap-table-filter)
-
-## Usage
-
-```html
-<script src="extensions/filter/bootstrap-table-filter.js"></script>
-```
-
-## Options
-
-### showFilter
-
-* type: Boolean
-* description: set true to show filter menu.
-* default: `false`

+ 31 - 0
docs/_i18n/es/extensions/filtercontrol.md

@@ -0,0 +1,31 @@
+# Table Filter Control
+
+Use Plugin: [bootstrap-table-filtercontrol](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/filtercontrol)
+
+## Usage
+
+```html
+<script src="extensions/filtercontrol/bootstrap-table-filtercontrol.js"></script>
+```
+
+## Options
+
+### filterControl
+
+* type: Boolean
+* description: Set true to add an `input` or `select` into the column.
+* default: `false`
+
+## Column options
+
+### filterControl
+
+* type: String
+* description: Set `input` or `select` to add one of those element into column.
+* default: `undefined`
+
+## Events
+
+### onColumnSearch(column-search.bs.table)
+
+* Fired when we are searching into the column data

+ 13 - 0
docs/_i18n/es/extensions/naturalsorting.md

@@ -0,0 +1,13 @@
+# Table Natural Sorting
+
+Use Plugin: [bootstrap-table-naturalsorting](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/naturalsorting)
+
+## Usage
+
+```html
+<script src="extensions/naturalsorting/bootstrap-table-naturalsorting.js"></script>
+```
+
+### Options
+
+* Just add data-sorter="alphanum" to any th

+ 35 - 0
docs/_i18n/es/extensions/reorder.md

@@ -0,0 +1,35 @@
+# Table Reorder
+
+Use Plugin: [bootstrap-table-reorder](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/reorder) </br>
+Dependence: [dragTable](https://github.com/akottr/dragtable/) v2.0.14 (must include the css file), </br>
+[jquery-ui](https://code.jquery.com/ui/) v1.11
+
+
+## Usage
+
+```html
+<link rel="stylesheet" href=".../dragtable.css">
+<script src=".../jquery-ui.js"></script>
+<script src=".../jquery.dragtable.js"></script>
+<script src="extensions/cookie/bootstrap-table-reorder.js"></script>
+```
+
+## Options
+
+### reorderable
+
+* type: Boolean
+* description: Set true to allow the reorder feature.
+* default: `false`
+
+### maxMovingRows
+
+* type: Integer
+* description: Moving only the header. Recommended for very large tables (cells > 1000)
+* default: `10`
+
+## Events
+
+### onReorder(reorder.bs.table)
+
+Fired when the column was dropped, receive as parameter the new header fields order

+ 0 - 17
docs/_i18n/zh-cn/extensions/README.md

@@ -1,17 +0,0 @@
-# Table Filter
-
-Use Plugin: [bootstrap table filters](https://github.com/lukaskral/bootstrap-table-filter)
-
-## Usage
-
-```html
-<script src="extensions/filter/bootstrap-table-filter.js"></script>
-```
-
-## Options
-
-### showFilter
-
-* type: Boolean
-* description: set true to show filter menu.
-* default: `false`

+ 31 - 0
docs/_i18n/zh-cn/extensions/filtercontrol.md

@@ -0,0 +1,31 @@
+# Table Filter Control
+
+Use Plugin: [bootstrap-table-filtercontrol](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/filtercontrol)
+
+## Usage
+
+```html
+<script src="extensions/filtercontrol/bootstrap-table-filtercontrol.js"></script>
+```
+
+## Options
+
+### filterControl
+
+* type: Boolean
+* description: Set true to add an `input` or `select` into the column.
+* default: `false`
+
+## Column options
+
+### filterControl
+
+* type: String
+* description: Set `input` or `select` to add one of those element into column.
+* default: `undefined`
+
+## Events
+
+### onColumnSearch(column-search.bs.table)
+
+* Fired when we are searching into the column data

+ 13 - 0
docs/_i18n/zh-cn/extensions/naturalsorting.md

@@ -0,0 +1,13 @@
+# Table Natural Sorting
+
+Use Plugin: [bootstrap-table-naturalsorting](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/naturalsorting)
+
+## Usage
+
+```html
+<script src="extensions/naturalsorting/bootstrap-table-naturalsorting.js"></script>
+```
+
+### Options
+
+* Just add data-sorter="alphanum" to any th

+ 35 - 0
docs/_i18n/zh-cn/extensions/reorder.md

@@ -0,0 +1,35 @@
+# Table Reorder
+
+Use Plugin: [bootstrap-table-reorder](https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/reorder) </br>
+Dependence: [dragTable](https://github.com/akottr/dragtable/) v2.0.14 (must include the css file), </br>
+[jquery-ui](https://code.jquery.com/ui/) v1.11
+
+
+## Usage
+
+```html
+<link rel="stylesheet" href=".../dragtable.css">
+<script src=".../jquery-ui.js"></script>
+<script src=".../jquery.dragtable.js"></script>
+<script src="extensions/cookie/bootstrap-table-reorder.js"></script>
+```
+
+## Options
+
+### reorderable
+
+* type: Boolean
+* description: Set true to allow the reorder feature.
+* default: `false`
+
+### maxMovingRows
+
+* type: Integer
+* description: Moving only the header. Recommended for very large tables (cells > 1000)
+* default: `10`
+
+## Events
+
+### onReorder(reorder.bs.table)
+
+Fired when the column was dropped, receive as parameter the new header fields order

+ 7 - 1
docs/extensions.md

@@ -15,8 +15,14 @@ lead: pages.extensions.lead
 
 {% tf extensions/resizable.md %}
 
+{% tf extensions/reorder.md %}
+
 {% tf extensions/filter.md %}
 
 {% tf extensions/keyevents.md %}
 
-{% tf extensions/mobile.md %}
+{% tf extensions/mobile.md %}
+
+{% tf extensions/filtercontrol.md %}
+
+{% tf extensions/naturalsorting.md %}

+ 6 - 1
src/bootstrap-table.js

@@ -1493,6 +1493,7 @@
         var that = this,
             $fixedHeader,
             $fixedBody,
+            fixedBody,
             scrollWidth;
 
         if (that.$el.is(':hidden')) {
@@ -1501,7 +1502,11 @@
         }
         $fixedHeader = this.$container.find('.fixed-table-header');
         $fixedBody = this.$container.find('.fixed-table-body');
-        scrollWidth = this.$el.width() > $fixedBody.width() ? getScrollBarWidth() : 0;
+        fixedBody = $fixedBody.get(0);
+
+        scrollWidth = fixedBody.scrollWidth > fixedBody.clientWidth &&
+            fixedBody.scrollHeight > fixedBody.clientHeight + this.$header.height() ?
+            getScrollBarWidth() : 0;
 
         this.$el.css('margin-top', -this.$header.height());
         this.$header_ = this.$header.clone(true, true);

+ 0 - 1
src/locale/README.md

@@ -133,7 +133,6 @@ quz-BO
 quz-EC
 quz-PE
 rm-CH
-ro-RO
 rw-RW
 sah-RU
 sa-IN

+ 43 - 0
src/locale/bootstrap-table-ro-RO.js

@@ -0,0 +1,43 @@
+/**
+ * Bootstrap Table Romanian translation
+ * Author: cristake <cristianiosif@me.com>
+ */
+(function ($) {
+    'use strict';
+
+    $.fn.bootstrapTable.locales['ro-RO'] = {
+        formatLoadingMessage: function () {
+            return 'Se incarca, va rugam asteptati...';
+        },
+        formatRecordsPerPage: function (pageNumber) {
+            return pageNumber + ' inregistrari pe pagina';
+        },
+        formatShowingRows: function (pageFrom, pageTo, totalRows) {
+            return 'Arata de la ' + pageFrom + ' pana la ' + pageTo + ' din ' + totalRows + ' randuri';
+        },
+        formatSearch: function () {
+            return 'Cauta';
+        },
+        formatNoMatches: function () {
+            return 'Nu au fost gasite inregistrari';
+        },
+        formatPaginationSwitch: function () {
+            return 'Ascunde/Arata paginatia';
+        },
+        formatRefresh: function () {
+            return 'Reincarca';
+        },
+        formatToggle: function () {
+            return 'Comuta';
+        },
+        formatColumns: function () {
+            return 'Coloane';
+        },
+        formatAllRows: function () {
+            return 'Toate';
+        }
+    };
+
+    $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['ro-RO']);
+
+})(jQuery);