When I select or change the number of rows to 25 from show entries and I click the 2 from my pagination Previous 123 Next then back to the minimum page which 10 from show entries I get an empty table. How can I avoid table from being empty even I change the show entries to 10/25/50/100 and click the pagination number? Here's my jsfiddle -> https://jsfiddle.net/ka6t8du1/8/
pagination : function(activePage) {
this.currentPage = activePage;
this.startIndex = (this.currentPage * this.show_entries) -
this.show_entries;
this.endIndex = parseInt(this.startIndex) +
parseInt(this.show_entries);
},
previous: function() {
if (this.currentPage > 1) {
this.pagination(this.currentPage - 1);
}
},
nextCategory: function() {
if (this.currentPage < this.totalCategory) {
this.pagination(this.currentPage + 1);
}
},
showEntries: function(value) {
this.endIndex = value ;
}
},
computed : {
totalCategory: function() {
return Math.ceil(this.categories.length / this.show_entries)
}
}