ソースを参照

Merge pull request #74 from wenzhixin/master

Update my repo
Dennis Hernández 10 年 前
コミット
cd85a98483

+ 50 - 0
dist/extensions/angular/bootstrap-table-angular.js

@@ -0,0 +1,50 @@
+// JavaScript source code
+(function () {
+  angular.module('bsTable', []).directive('bsTableControl', function () {
+    var SEARCH_SELECTOR = '.search input';
+    var CONTAINER_SELECTOR = '.bootstrap-table';
+    return {
+      restrict: 'EA',
+      scope: {options: '='},
+      link: function ($s, $el) {
+        var scroll;
+        var options;
+        $el
+          .on('sort.bs.table', function (evt, sortName, sortOrder) {
+            if (!options) return;
+            options.sortName = sortName;
+            options.sortOrder = sortOrder;
+          })
+          .on('page-change.bs.table', function (evt, pageNumber, pageSize) {
+            if (!options) return;
+            options.pageNumber = pageNumber;
+            options.pageSize = pageSize;
+          })
+          .on('search.bs.table', function (evt, searchText) {
+            if (!options) return;
+            options.searchText = searchText;
+          });
+        $s.$watch('options', function (newOptions) {
+          if (!newOptions) return;
+
+          var searchHasFocus = $el.closest(CONTAINER_SELECTOR).find(SEARCH_SELECTOR).is(':focus');
+          if (options) {
+            scroll = $el.bootstrapTable('getScrollPosition');
+            $el.bootstrapTable('destroy');
+          }
+          newOptions = angular.copy(newOptions);
+          if (options) angular.forEach(['sortName', 'sortOrder', 'pageNumber', 'pageSize', 'searchText'], function (key) {
+            if (key in options) newOptions[key] = options[key];
+          });
+          options = newOptions;
+          $el.bootstrapTable(options);
+          if (scroll) $el.bootstrapTable('scrollTo', scroll);
+          if (searchHasFocus) $el.closest(CONTAINER_SELECTOR).find(SEARCH_SELECTOR).focus(); // $el gets detached so have to recompute whole chain
+        }, true);
+        $(window).resize(function () {
+          if (options) $el.bootstrapTable('resetView');
+        });
+      }
+    };
+  })
+})();

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


+ 7 - 0
docs/_i18n/en/extensions/filter-control.md

@@ -17,6 +17,13 @@ Dependence if you use the datepicker option: [bootstrap-datepicker](https://gith
 * description: Set true to add an `input` or `select` into the column.
 * default: `false`
 
+### filterShowClear
+
+* type: Boolean
+* description: Set true to add a button to clear all the controls added by this plugin
+* default: `false`
+
+
 ## Column options
 
 ### filterControl

+ 41 - 0
docs/_i18n/en/extensions/group-by.md

@@ -0,0 +1,41 @@
+# Table group-by
+
+Use Plugin: [bootstrap-table-group-by](https://github.com/djhvscf/bootstrap-table-group-by) </br>
+Dependence: [jquery-treetable](https://github.com/ludo/jquery-treetable/) v3.2.0 </br>
+You must include the bootstrap-table-group-by.css file in order to get the appropriate style
+
+## Usage
+
+```html
+<script src="extensions/group-by/bootstrap-table-group-by.js"></script>
+```
+
+## Options
+
+### groupBy
+
+* type: Boolean
+* description: Set true to group the data by the field passed.
+* default: `false`
+
+### groupByField
+
+* type: String
+* description: Set the field that you want to group the data.
+* default: ``
+
+## Methods
+
+### expandAll
+
+* Expand all the nodes in the table.
+
+### collapseAll
+
+* Collapse all the nodes in the table.
+
+## Known issues
+
+### OnSort
+
+* When sort options are set to True the group by is not working properly, for now if these properties are set to True the group by extension will be disabled.

+ 6 - 0
docs/_i18n/en/extensions/mobile.md

@@ -33,3 +33,9 @@ Use Plugin: [bootstrap-table-mobile](https://github.com/wenzhixin/bootstrap-tabl
 * type: Integer
 * description: Set the minimum height when the table will change the view.
 * default: `undefined`
+
+### columnsHidden
+
+* type: String
+* description: Set the columns fields in this array in order to hide those columns in the cardView mode. Use this way in `data-*` configuration: ` data-columns-hidden="['name', 'description']"` or this way in javascript configuration: `columnsHidden = ['name', 'description']`. 
+* default: `undefined`

+ 7 - 0
docs/_i18n/es/extensions/filter-control.md

@@ -17,6 +17,13 @@ Dependence if you use the datepicker option: [bootstrap-datepicker](https://gith
 * description: Set true to add an `input` or `select` into the column.
 * default: `false`
 
+### filterShowClear
+
+* type: Boolean
+* description: Set true to add a button to clear all the controls added by this plugin
+* default: `false`
+
+
 ## Column options
 
 ### filterControl

+ 41 - 0
docs/_i18n/es/extensions/group-by.md

@@ -0,0 +1,41 @@
+# Table group-by
+
+Use Plugin: [bootstrap-table-group-by](https://github.com/djhvscf/bootstrap-table-group-by) </br>
+Dependence: [jquery-treetable](https://github.com/ludo/jquery-treetable/) v3.2.0 </br>
+You must include the bootstrap-table-group-by.css file in order to get the appropriate style
+
+## Usage
+
+```html
+<script src="extensions/group-by/bootstrap-table-group-by.js"></script>
+```
+
+## Options
+
+### groupBy
+
+* type: Boolean
+* description: Set true to group the data by the field passed.
+* default: `false`
+
+### groupByField
+
+* type: String
+* description: Set the field that you want to group the data.
+* default: ``
+
+## Methods
+
+### expandAll
+
+* Expand all the nodes in the table.
+
+### collapseAll
+
+* Collapse all the nodes in the table.
+
+## Known issues
+
+### OnSort
+
+* When sort options are set to True the group by is not working properly, for now if these properties are set to True the group by extension will be disabled.

+ 6 - 0
docs/_i18n/es/extensions/mobile.md

@@ -33,3 +33,9 @@ Use Plugin: [bootstrap-table-mobile](https://github.com/wenzhixin/bootstrap-tabl
 * type: Integer
 * description: Set the minimum height when the table will change the view.
 * default: `undefined`
+
+### columnsHidden
+
+* type: String
+* description: Set the columns fields in this array in order to hide those columns in the cardView mode. Use this way in `data-*` configuration: ` data-columns-hidden="['name', 'description']"` or this way in javascript configuration: `columnsHidden = ['name', 'description']`. 
+* default: `undefined`

+ 7 - 0
docs/_i18n/zh-cn/extensions/filter-control.md

@@ -17,6 +17,13 @@ Dependence if you use the datepicker option: [bootstrap-datepicker](https://gith
 * description: Set true to add an `input` or `select` into the column.
 * default: `false`
 
+### filterShowClear
+
+* type: Boolean
+* description: Set true to add a button to clear all the controls added by this plugin
+* default: `false`
+
+
 ## Column options
 
 ### filterControl

+ 41 - 0
docs/_i18n/zh-cn/extensions/group-by.md

@@ -0,0 +1,41 @@
+# Table group-by
+
+Use Plugin: [bootstrap-table-group-by](https://github.com/djhvscf/bootstrap-table-group-by) </br>
+Dependence: [jquery-treetable](https://github.com/ludo/jquery-treetable/) v3.2.0 </br>
+You must include the bootstrap-table-group-by.css file in order to get the appropriate style
+
+## Usage
+
+```html
+<script src="extensions/group-by/bootstrap-table-group-by.js"></script>
+```
+
+## Options
+
+### groupBy
+
+* type: Boolean
+* description: Set true to group the data by the field passed.
+* default: `false`
+
+### groupByField
+
+* type: String
+* description: Set the field that you want to group the data.
+* default: ``
+
+## Methods
+
+### expandAll
+
+* Expand all the nodes in the table.
+
+### collapseAll
+
+* Collapse all the nodes in the table.
+
+## Known issues
+
+### OnSort
+
+* When sort options are set to True the group by is not working properly, for now if these properties are set to True the group by extension will be disabled.

+ 6 - 0
docs/_i18n/zh-cn/extensions/mobile.md

@@ -33,3 +33,9 @@ Use Plugin: [bootstrap-table-mobile](https://github.com/wenzhixin/bootstrap-tabl
 * type: Integer
 * description: Set the minimum height when the table will change the view.
 * default: `undefined`
+
+### columnsHidden
+
+* type: String
+* description: Set the columns fields in this array in order to hide those columns in the cardView mode. Use this way in `data-*` configuration: ` data-columns-hidden="['name', 'description']"` or this way in javascript configuration: `columnsHidden = ['name', 'description']`. 
+* default: `undefined`

+ 8 - 5
docs/_includes/nav/main.html

@@ -15,9 +15,6 @@
                 <li {% if page.slug == "getting-started" %} class="active"{% endif %}>
                     <a href="{{ site.baseurl }}/getting-started/">{% t pages.getting_started.title %}</a>
                 </li>
-                <li {% if page.slug == "examples" %} class="active"{% endif %}>
-                    <a href="{{ site.baseurl }}/examples/">{% t pages.examples.title %}</a>
-                </li>
                 <li {% if page.slug == "documentation" %} class="active"{% endif %}>
                     <a href="{{ site.baseurl }}/documentation/">{% t pages.documentation.title %}</a>
                 </li>
@@ -28,10 +25,16 @@
                     <a href="{{ site.baseurl }}/faq/">{% t pages.faq.title %}</a>
                 </li>
                 <li>
-                    <a href="{{ site.repo }}" target="_blank">GitHub</a>
+                    <a href="http://issues.wenzhixin.net.cn/bootstrap-table/" target="_blank">Examples</a>
+                </li>
+                <li>
+                    <a href="http://bootstrap-group-select.wenzhixin.net.cn" target="_blank">
+                        Bootstrap Group Select
+                        <span class="badge">New</span>
+                    </a>
                 </li>
                 <li>
-                    <a href="http://issues.wenzhixin.net.cn/bootstrap-table/" target="_blank">Bootstrap Table Examples <span class="badge">New</span></a>
+                    <a href="{{ site.repo }}" target="_blank">GitHub</a>
                 </li>
             </ul>
             <ul class="nav navbar-nav navbar-right">

+ 50 - 0
docs/dist/extensions/angular/bootstrap-table-angular.js

@@ -0,0 +1,50 @@
+// JavaScript source code
+(function () {
+  angular.module('bsTable', []).directive('bsTableControl', function () {
+    var SEARCH_SELECTOR = '.search input';
+    var CONTAINER_SELECTOR = '.bootstrap-table';
+    return {
+      restrict: 'EA',
+      scope: {options: '='},
+      link: function ($s, $el) {
+        var scroll;
+        var options;
+        $el
+          .on('sort.bs.table', function (evt, sortName, sortOrder) {
+            if (!options) return;
+            options.sortName = sortName;
+            options.sortOrder = sortOrder;
+          })
+          .on('page-change.bs.table', function (evt, pageNumber, pageSize) {
+            if (!options) return;
+            options.pageNumber = pageNumber;
+            options.pageSize = pageSize;
+          })
+          .on('search.bs.table', function (evt, searchText) {
+            if (!options) return;
+            options.searchText = searchText;
+          });
+        $s.$watch('options', function (newOptions) {
+          if (!newOptions) return;
+
+          var searchHasFocus = $el.closest(CONTAINER_SELECTOR).find(SEARCH_SELECTOR).is(':focus');
+          if (options) {
+            scroll = $el.bootstrapTable('getScrollPosition');
+            $el.bootstrapTable('destroy');
+          }
+          newOptions = angular.copy(newOptions);
+          if (options) angular.forEach(['sortName', 'sortOrder', 'pageNumber', 'pageSize', 'searchText'], function (key) {
+            if (key in options) newOptions[key] = options[key];
+          });
+          options = newOptions;
+          $el.bootstrapTable(options);
+          if (scroll) $el.bootstrapTable('scrollTo', scroll);
+          if (searchHasFocus) $el.closest(CONTAINER_SELECTOR).find(SEARCH_SELECTOR).focus(); // $el gets detached so have to recompute whole chain
+        }, true);
+        $(window).resize(function () {
+          if (options) $el.bootstrapTable('resetView');
+        });
+      }
+    };
+  })
+})();

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


+ 50 - 0
src/extensions/angular/bootstrap-table-angular.js

@@ -0,0 +1,50 @@
+// JavaScript source code
+(function () {
+  angular.module('bsTable', []).directive('bsTableControl', function () {
+    var SEARCH_SELECTOR = '.search input';
+    var CONTAINER_SELECTOR = '.bootstrap-table';
+    return {
+      restrict: 'EA',
+      scope: {options: '='},
+      link: function ($s, $el) {
+        var scroll;
+        var options;
+        $el
+          .on('sort.bs.table', function (evt, sortName, sortOrder) {
+            if (!options) return;
+            options.sortName = sortName;
+            options.sortOrder = sortOrder;
+          })
+          .on('page-change.bs.table', function (evt, pageNumber, pageSize) {
+            if (!options) return;
+            options.pageNumber = pageNumber;
+            options.pageSize = pageSize;
+          })
+          .on('search.bs.table', function (evt, searchText) {
+            if (!options) return;
+            options.searchText = searchText;
+          });
+        $s.$watch('options', function (newOptions) {
+          if (!newOptions) return;
+
+          var searchHasFocus = $el.closest(CONTAINER_SELECTOR).find(SEARCH_SELECTOR).is(':focus');
+          if (options) {
+            scroll = $el.bootstrapTable('getScrollPosition');
+            $el.bootstrapTable('destroy');
+          }
+          newOptions = angular.copy(newOptions);
+          if (options) angular.forEach(['sortName', 'sortOrder', 'pageNumber', 'pageSize', 'searchText'], function (key) {
+            if (key in options) newOptions[key] = options[key];
+          });
+          options = newOptions;
+          $el.bootstrapTable(options);
+          if (scroll) $el.bootstrapTable('scrollTo', scroll);
+          if (searchHasFocus) $el.closest(CONTAINER_SELECTOR).find(SEARCH_SELECTOR).focus(); // $el gets detached so have to recompute whole chain
+        }, true);
+        $(window).resize(function () {
+          if (options) $el.bootstrapTable('resetView');
+        });
+      }
+    };
+  })
+})();