Browse Source

Added getScrollPosition method

Dennis Hernández 10 years ago
parent
commit
1bf11c7a7b
1 changed files with 10 additions and 1 deletions
  1. 10 1
      src/bootstrap-table.js

+ 10 - 1
src/bootstrap-table.js

@@ -319,7 +319,7 @@
         cellStyle: undefined,
         searchable: true,
         cardVisible: true,
-        filterControl: undefined // edit, todo: select, todo: date
+        filterControl: undefined // edit, select, todo: date
     };
 
     BootstrapTable.EVENTS = {
@@ -2060,8 +2060,16 @@
         if (typeof value === 'number') {
             $tbody.scrollTop(value);
         }
+
+        if (typeof value === undefined) {
+            return $tbody.scrollTop();
+        }
     };
 
+    BootstrapTable.prototype.getScrollPosition = function () {
+        return this.scrollTo();
+    }
+
     BootstrapTable.prototype.selectPage = function (page) {
         if (page > 0 && page <= this.options.totalPages) {
             this.options.pageNumber = page;
@@ -2112,6 +2120,7 @@
         'showColumn', 'hideColumn',
         'filterBy',
         'scrollTo',
+        'getScrollPosition',
         'selectPage', 'prevPage', 'nextPage',
         'togglePagination',
         'toggleView'