Commit e75984c4 by Kalyani Committed by nixonrodrigues

ATLAS-1817 : UI : n+1 pages are created, even though only n*25 instances are retrieved

parent 64988b8a
...@@ -255,7 +255,12 @@ define(['require', ...@@ -255,7 +255,12 @@ define(['require',
if (!(that.ui.pageRecordText instanceof jQuery)) { if (!(that.ui.pageRecordText instanceof jQuery)) {
return; return;
} }
if (that.searchCollection.models.length === 0) {
that.ui.nextData.attr('disabled', true);
that.offset = that.offset - that.limit;
that.hideLoader();
return;
}
if (that.searchCollection.models.length < that.limit) { if (that.searchCollection.models.length < that.limit) {
that.ui.nextData.attr('disabled', true); that.ui.nextData.attr('disabled', true);
} else { } else {
...@@ -272,7 +277,7 @@ define(['require', ...@@ -272,7 +277,7 @@ define(['require',
that.pageTo = that.pageTo - that.limit; that.pageTo = that.pageTo - that.limit;
that.pageFrom = (that.pageTo - that.limit) + 1; that.pageFrom = (that.pageTo - that.limit) + 1;
} }
that.ui.pageRecordText.html("Showing <u>" + that.searchCollection.models.length + " records</u>, from " + that.pageFrom + " - " + that.pageTo); that.ui.pageRecordText.html("Showing <u>" + that.searchCollection.models.length + " records</u> From " + that.pageFrom + " - " + that.pageTo);
if (that.offset < that.limit && that.pageFrom < 26) { if (that.offset < that.limit && that.pageFrom < 26) {
that.ui.previousData.attr('disabled', true); that.ui.previousData.attr('disabled', true);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment