ソースを参照

Merge pull request #3223 from mqy1023/develop

Add table's body scrolling event listener function
文翼 8 年 前
コミット
5389059e72
1 ファイル変更7 行追加1 行削除
  1. 7 1
      src/bootstrap-table.js

+ 7 - 1
src/bootstrap-table.js

@@ -487,6 +487,9 @@
         },
         onResetView: function () {
             return false;
+        },
+        onScrollBody: function () {
+            return false;
         }
     };
 
@@ -586,7 +589,8 @@
         'collapse-row.bs.table': 'onCollapseRow',
         'refresh-options.bs.table': 'onRefreshOptions',
         'reset-view.bs.table': 'onResetView',
-        'refresh.bs.table': 'onRefresh'
+        'refresh.bs.table': 'onRefresh',
+        'scroll-body.bs.table': 'onScrollBody'
     };
 
     BootstrapTable.prototype.init = function () {
@@ -2352,6 +2356,8 @@
         var that = this;
         // horizontal scroll event
         // TODO: it's probably better improving the layout than binding to scroll event
+
+        that.trigger('scroll-body');
         this.$tableBody.off('scroll').on('scroll', function () {
             if (that.options.showHeader && that.options.height) {
               that.$tableHeader.scrollLeft($(this).scrollLeft());