Browse Source

`updateSelected()` traversing too far, hit performance

Fix #1192
Example [here](http://jsfiddle.net/qdywt77g/) with bug
Example [here](http://jsfiddle.net/qdywt77g/1/) without bug
Dennis Hernández 10 years ago
parent
commit
d948633fb3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/bootstrap-table.js

+ 1 - 1
src/bootstrap-table.js

@@ -1733,7 +1733,7 @@
         this.$selectAll.add(this.$selectAll_).prop('checked', checkAll);
 
         this.$selectItem.each(function () {
-            $(this).parents('tr')[$(this).prop('checked') ? 'addClass' : 'removeClass']('selected');
+            $(this).closest('tr')[$(this).prop('checked') ? 'addClass' : 'removeClass']('selected');
         });
     };