Browse Source

Merge pull request #3 from wenzhixin/develop

Update branch
Dennis Hernández 9 years ago
parent
commit
382d272f9e

+ 3 - 0
CHANGELOG.md

@@ -8,12 +8,15 @@ ChangeLog
 - fix(js): fix #2385, checkbox render bug with formatter
 - fix(js): fix #750, showRow and hideRow bug
 - fix(js): fix #2387, page list bug
+- fix(js): decrement totalRows on remove if using server side pagination
 - feat(js): fix #2414, add `paginationLoop` option
 - feat(js): update method `getRowsHidden` to `getHiddenRows`
 - feat(js): add `sortClass` option
 - feat(js): add `totalField` Option
+- fix(css): fix #2208, dropdown-menu style bug
 - fix(filter-control extension): fix #2418, `height` cause datepicker not display the selected date
 - fix(export extension): fix #2220, selected rows does not work when data-pagination-side is server
+- fix(reorder-row extension): fix #1343, reorder rows bug with pagination
 - feat(cookie extension): fix #2386, add `getCookies` method
 - feat(multiple-selection-row extension): add multiple-selection-row extension
 - feat(filter-control extension): fix #1540, disable unnecessary/unused values from select options

+ 3 - 0
src/bootstrap-table.js

@@ -2412,6 +2412,9 @@
             }
             if ($.inArray(row[params.field], params.values) !== -1) {
                 this.options.data.splice(i, 1);
+                if (this.options.sidePagination === 'server') {
+                    this.options.totalRows -= 1;
+                }
             }
         }
 

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

@@ -1,10 +1,10 @@
 /**
  * @author: Dennis Hernández
  * @webSite: http://djhvscf.github.io/Blog
- * @version: v1.0.0
+ * @version: v1.0.1
  */
 
-!function ($) {
+(function ($) {
 
     'use strict';
 
@@ -105,7 +105,9 @@
             row.data('index', i).attr('data-index', i);
         }
 
-        tableBsOptions.data = newData;
+        tableBsOptions.data = tableBsOptions.data.slice(0, tableBsData.pageFrom - 1)
+            .concat(newData)
+            .concat(tableBsOptions.data.slice(tableBsData.pageTo));
 
         //Call the user defined function
         tableBsOptions.onReorderRowsDrop.apply(table, [table, droppedRow]);
@@ -113,4 +115,4 @@
         //Call the event reorder-row
         tableBsData.trigger('reorder-row', newData);
     };
-}(jQuery);
+})(jQuery);