Commit 83fbe467 by kevalbhatt

ATLAS-3007 UI : Add go to page and page limit option for local pagination

parent 2a3b8830
...@@ -45,7 +45,17 @@ ...@@ -45,7 +45,17 @@
<div class="row clearfix banded pagination-box"> <div class="row clearfix banded pagination-box">
<div class="col-sm-offset-4 col-sm-8"> <div class="col-sm-offset-4 col-sm-8">
<div class="inline-content-fr"> <div class="inline-content-fr">
<div data-id="r_pagination" class="inline"></div> <div data-id="r_pagination" data-id="paginationDiv" class="inline"></div>
{{#if includeGotoPage}}
<div class="inline col-sm-4" data-id="paginationDiv" style="display:none">
<div class="input-group" data-id="goToPageDiv">
<input type="text" class="form-control number-input" data-id="gotoPage" placeholder="Goto Page" />
<span class="input-group-btn">
<button class="btn btn-default" type="button" data-id="gotoPagebtn" title="Goto Page" disabled="disabled">Go!</button>
</span>
</div>
</div>
{{/if}}
{{#if includePageSize}} {{#if includePageSize}}
<div class="inline"> <div class="inline">
<div class="inline-content"> <div class="inline-content">
......
...@@ -79,7 +79,8 @@ define(['require', ...@@ -79,7 +79,8 @@ define(['require',
collection: this.schemaCollection, collection: this.schemaCollection,
includeFilter: false, includeFilter: false,
includePagination: true, includePagination: true,
includePageSize: false, includePageSize: true,
includeGotoPage: true,
includeFooterRecords: true, includeFooterRecords: true,
includeOrderAbleColumns: false, includeOrderAbleColumns: false,
gridOpts: { gridOpts: {
......
...@@ -375,6 +375,9 @@ define(['require', ...@@ -375,6 +375,9 @@ define(['require',
if (that.isDestroyed) { if (that.isDestroyed) {
return; return;
} }
that.ui.gotoPage.val('');
that.ui.gotoPage.parent().removeClass('has-error');
that.ui.gotoPagebtn.prop("disabled", true);
Globals.searchApiCallRef = undefined; Globals.searchApiCallRef = undefined;
var isFirstPage = that.offset === 0, var isFirstPage = that.offset === 0,
dataLength = 0, dataLength = 0,
...@@ -1006,8 +1009,6 @@ define(['require', ...@@ -1006,8 +1009,6 @@ define(['require',
this.value.pageOffset = this.offset; this.value.pageOffset = this.offset;
this.triggerUrl(); this.triggerUrl();
} }
this.ui.gotoPage.val('');
this.ui.gotoPage.parent().removeClass('has-error');
this.fetchCollection(null, { this.fetchCollection(null, {
next: true next: true
}); });
...@@ -1024,8 +1025,6 @@ define(['require', ...@@ -1024,8 +1025,6 @@ define(['require',
this.value.pageOffset = this.offset; this.value.pageOffset = this.offset;
this.triggerUrl(); this.triggerUrl();
} }
this.ui.gotoPage.val('');
this.ui.gotoPage.parent().removeClass('has-error');
this.fetchCollection(null, { this.fetchCollection(null, {
previous: true previous: true
}); });
...@@ -1074,8 +1073,6 @@ define(['require', ...@@ -1074,8 +1073,6 @@ define(['require',
this.value.pageOffset = this.offset; this.value.pageOffset = this.offset;
this.triggerUrl(); this.triggerUrl();
} }
this.ui.gotoPage.val('');
this.ui.gotoPage.parent().removeClass('has-error');
_.extend(this.searchCollection.queryParams, { limit: this.limit, offset: this.offset }); _.extend(this.searchCollection.queryParams, { limit: this.limit, offset: this.offset });
this.fetchCollection(); this.fetchCollection();
} }
......
...@@ -86,6 +86,8 @@ define(['require', ...@@ -86,6 +86,8 @@ define(['require',
includePagination: true, includePagination: true,
includePageSize: false, includePageSize: false,
includeFooterRecords: true, includeFooterRecords: true,
includePageSize: true,
includeGotoPage: true,
gridOpts: { gridOpts: {
className: "table table-hover backgrid table-quickMenu", className: "table table-hover backgrid table-quickMenu",
emptyText: 'No records found!' emptyText: 'No records found!'
......
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