Skip to content

Commit

Permalink
refresh current page function
Browse files Browse the repository at this point in the history
  • Loading branch information
mlt committed Nov 28, 2019
1 parent 15634b9 commit 4a9fedc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/assets/javascripts/tabulatr/_tabulatr.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ function Tabulatr(id){
Tabulatr.prototype = {
constructor: Tabulatr,

refreshPage: function() {
var p = $('.pagination[data-table="' + this.id + '"]>.active>a').data('page');
if (typeof(p) == undefined)
p = 1;
this.updateTable({page: p}, true);
},

updateTable: function(hash, forceReload) {
var $table = $('#'+ this.id);
this.storePage = this.pageShouldBeStored(hash.page, forceReload);
Expand Down

0 comments on commit 4a9fedc

Please sign in to comment.