Commit 83fbe467 by kevalbhatt

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

parent 2a3b8830
......@@ -45,7 +45,17 @@
<div class="row clearfix banded pagination-box">
<div class="col-sm-offset-4 col-sm-8">
<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}}
<div class="inline">
<div class="inline-content">
......
......@@ -79,7 +79,8 @@ define(['require',
collection: this.schemaCollection,
includeFilter: false,
includePagination: true,
includePageSize: false,
includePageSize: true,
includeGotoPage: true,
includeFooterRecords: true,
includeOrderAbleColumns: false,
gridOpts: {
......
......@@ -375,6 +375,9 @@ define(['require',
if (that.isDestroyed) {
return;
}
that.ui.gotoPage.val('');
that.ui.gotoPage.parent().removeClass('has-error');
that.ui.gotoPagebtn.prop("disabled", true);
Globals.searchApiCallRef = undefined;
var isFirstPage = that.offset === 0,
dataLength = 0,
......@@ -1006,8 +1009,6 @@ define(['require',
this.value.pageOffset = this.offset;
this.triggerUrl();
}
this.ui.gotoPage.val('');
this.ui.gotoPage.parent().removeClass('has-error');
this.fetchCollection(null, {
next: true
});
......@@ -1024,8 +1025,6 @@ define(['require',
this.value.pageOffset = this.offset;
this.triggerUrl();
}
this.ui.gotoPage.val('');
this.ui.gotoPage.parent().removeClass('has-error');
this.fetchCollection(null, {
previous: true
});
......@@ -1074,8 +1073,6 @@ define(['require',
this.value.pageOffset = this.offset;
this.triggerUrl();
}
this.ui.gotoPage.val('');
this.ui.gotoPage.parent().removeClass('has-error');
_.extend(this.searchCollection.queryParams, { limit: this.limit, offset: this.offset });
this.fetchCollection();
}
......
......@@ -86,6 +86,8 @@ define(['require',
includePagination: true,
includePageSize: false,
includeFooterRecords: true,
includePageSize: true,
includeGotoPage: true,
gridOpts: {
className: "table table-hover backgrid table-quickMenu",
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