Browse Source

Fix Reorder column order issue when column is invisble

Fix #1031
Dennis Hernández 10 years ago
parent
commit
6d6fde0947

+ 6 - 0
src/extensions/reorder-columns/README.md

@@ -28,6 +28,12 @@ Dependence: [dragTable](https://github.com/akottr/dragtable/) v2.0.14 (must incl
 * description: Moving only the header. Recommended for very large tables (cells > 1000)
 * description: Moving only the header. Recommended for very large tables (cells > 1000)
 * default: `10`
 * default: `10`
 
 
+### dragaccept
+
+* type: String
+* description: Allow to drag only the rows that have the css class as attribute.
+* default: `null`
+
 ## Events
 ## Events
 
 
 ### onReorderColumn(reorder-column.bs.table)
 ### onReorderColumn(reorder-column.bs.table)

+ 3 - 2
src/extensions/reorder-columns/bootstrap-table-reorder-columns.js

@@ -26,7 +26,8 @@
         maxMovingRows: 10,
         maxMovingRows: 10,
         onReorderColumn: function (headerFields) {
         onReorderColumn: function (headerFields) {
             return false;
             return false;
-        }
+        },
+        dragaccept: null
     });
     });
 
 
     $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
     $.extend($.fn.bootstrapTable.Constructor.EVENTS, {
@@ -84,13 +85,13 @@
     };
     };
 
 
     BootstrapTable.prototype.makeRowsReorderable = function () {
     BootstrapTable.prototype.makeRowsReorderable = function () {
-
         var that = this;
         var that = this;
         try {
         try {
             $(this.$el).dragtable('destroy');
             $(this.$el).dragtable('destroy');
         } catch (e) {}
         } catch (e) {}
         $(this.$el).dragtable({
         $(this.$el).dragtable({
             maxMovingRows: that.options.maxMovingRows,
             maxMovingRows: that.options.maxMovingRows,
+            dragaccept: that.options.dragaccept,
             clickDelay:200,
             clickDelay:200,
             beforeStop: function() {
             beforeStop: function() {
                 var ths = [],
                 var ths = [],