Browse Source

Merge pull request #1201 from nours/reorder

Reorder Row issues
文翼 10 years ago
parent
commit
31c2e65fa1
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/extensions/reorder-rows/bootstrap-table-reorder-rows.js

+ 4 - 4
src/extensions/reorder-rows/bootstrap-table-reorder-rows.js

@@ -44,8 +44,6 @@
 
     BootstrapTable.prototype.init = function () {
 
-        _init.apply(this, Array.prototype.slice.apply(arguments));
-
         if (!this.options.reorderableRows) {
             return;
         }
@@ -62,6 +60,8 @@
                 onPostBody.apply();
             }, 1);
         };
+
+        _init.apply(this, Array.prototype.slice.apply(arguments));
     };
 
     BootstrapTable.prototype.initSearch = function () {
@@ -91,7 +91,7 @@
         });
     };
 
-    BootstrapTable.prototype.onDrop = function (table, row) {
+    BootstrapTable.prototype.onDrop = function (table, droppedRow) {
         var tableBs = $(table),
             tableBsData = tableBs.data('bootstrap.table'),
             tableBsOptions = tableBs.data('bootstrap.table').options,
@@ -107,7 +107,7 @@
         tableBsOptions.data = newData;
 
         //Call the user defined function
-        tableBsOptions.onReorderRowsDrop.apply(table, row);
+        tableBsOptions.onReorderRowsDrop.apply(table, [table, droppedRow]);
 
         //Call the event reorder-row
         tableBsData.trigger('reorder-row', newData);