ソースを参照

Merge pull request #3689 from wenzhixin/revert-3674-patch-1

Revert "Remove `fixed` option from resizable extension"
文翼 7 年 前
コミット
4b6fd6b375

+ 6 - 0
src/extensions/resizable/README.md

@@ -23,6 +23,12 @@ Dependence: [colResizable](https://github.com/alvaro-prieto/colResizable) v1.6
 * description: When set to true the table layout is updated while dragging column anchors. liveDrag enabled is more CPU consuming so it is not recommended for slow computers, specially when dealing with huge or extremely complicated tables.
 * default: `false`
 
+### fixed
+
+* type: Boolean
+* description: It is used to set how the resize method works. In fixed mode resizing a column does not alter total table width, which means that when a column is expanded the next one shrinks. If fixed is set to false then table can change its width and each column can shrink or expand independently.
+* default: `true`
+
 ### headerOnly
 
 * type: Boolean

+ 3 - 1
src/extensions/resizable/bootstrap-table-resizable.js

@@ -1,7 +1,7 @@
 /**
  * @author: Dennis Hernández
  * @webSite: http://djhvscf.github.io/Blog
- * @version: v1.1.1
+ * @version: v1.0.0
  */
 
 (function ($) {
@@ -14,6 +14,7 @@
         //Creates the plugin
         that.$el.colResizable({
             liveDrag: that.options.liveDrag,
+            fixed: that.options.fixed,
             headerOnly: that.options.headerOnly,
             minWidth: that.options.minWidth,
             hoverCursor: that.options.hoverCursor,
@@ -27,6 +28,7 @@
     $.extend($.fn.bootstrapTable.defaults, {
         resizable: false,
         liveDrag: false,
+        fixed: true,
         headerOnly: false,
         minWidth: 15,
         hoverCursor: 'e-resize',

+ 1 - 1
src/extensions/resizable/extension.json

@@ -1,6 +1,6 @@
 {
   "name": "Resizable",
-  "version": "1.1.1",
+  "version": "1.1.0",
   "description": "Plugin to support the resizable feature.",
   "url": "https://github.com/wenzhixin/bootstrap-table/tree/master/src/extensions/resizable",
   "example": "http://issues.wenzhixin.net.cn/bootstrap-table/#extensions/resizable.html",