ソースを参照

Updated cookie extension with selectPage Method.

Updated cookie extension to extend the selectPage Method so that it updates the state save page number cookie.
Xandertje 10 年 前
コミット
d9d86af500
1 ファイル変更6 行追加0 行削除
  1. 6 0
      src/extensions/cookie/bootstrap-table-cookie.js

+ 6 - 0
src/extensions/cookie/bootstrap-table-cookie.js

@@ -112,6 +112,7 @@
         _onPageNext = BootstrapTable.prototype.onPageNext,
         _onPageLast = BootstrapTable.prototype.onPageLast,
         _toggleColumn = BootstrapTable.prototype.toggleColumn,
+        _selectPage = BootstrapTable.prototype.selectPage,
         _onSearch = BootstrapTable.prototype.onSearch;
 
     // init save data after initTable function
@@ -203,6 +204,11 @@
 
         setCookie(this, cookieIds.columns, JSON.stringify(visibleColumns));
     };
+    
+    BootstrapTable.prototype.selectPage = function (page) {
+        _selectPage.apply(this, Array.prototype.slice.apply(arguments));
+        setCookie(this, idsStateSaveList.pageNumber, page);
+    };
 
     BootstrapTable.prototype.onSearch = function () {
         _onSearch.apply(this, Array.prototype.slice.apply(arguments));