Browse Source

Fix click-row event bug.

zhixin 11 years ago
parent
commit
7201a33280
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/bootstrap-table.js

+ 5 - 2
src/bootstrap-table.js

@@ -838,10 +838,13 @@
 
         // click to select by column
         this.$body.find('> tr > td').off('click').on('click', function () {
+            var $tr = $(this).parent();
+            that.trigger('click-row', that.data[$tr.data('index')], $tr);
             // if click to select - then trigger the checkbox/radio click
             if (that.options.clickToSelect) {
-                if (that.header.clickToSelects[$(this).parent().children().index($(this))]){
-                    $(this).parent().find(sprintf('[name="%s"]', that.options.selectItemName)).trigger('click');
+                if (that.header.clickToSelects[$tr.children().index($(this))]) {
+                    $tr.find(sprintf('[name="%s"]',
+                        that.options.selectItemName)).trigger('click');
                 }
             }
         });