Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FEATURE: Input box for going to a page in gridfield

  • Loading branch information...
commit 4ad7e8ef8d285e4f143bf54ad9ea0b7ccedacf81 1 parent 38db2c1
@ajoneil ajoneil authored
View
14 javascript/GridField.js
@@ -247,4 +247,18 @@
}
});
+ $(".ss-gridfield .pagination-page-number input").entwine({
+ onkeydown: function(event) {
+ if(event.keyCode == 13) {
+ var newpage = parseInt($(this).val(), 10);
+
+ var gridfield = $(this).getGridField();
+ gridfield.setState('GridFieldPaginator', {currentPage: newpage});
+ gridfield.reload();
+
+ return false;
+ }
+ }
+ });
+
}(jQuery));
View
2  templates/Includes/GridFieldPaginator_Row.ss
@@ -1,7 +1,7 @@
<tr>
<td class="bottom-all" colspan="$Colspan">
<div class="datagrid-pagination">
- $FirstPage $PreviousPage <span class="pagination-page-number">Page $CurrentPageNum of $NumPages</span> $NextPage $LastPage
+ $FirstPage $PreviousPage <span class="pagination-page-number">Page <input value="$CurrentPageNum"/> of $NumPages</span> $NextPage $LastPage
</div>
<span class="pagination-records-number">View $FirstShownRecord - $LastShownRecord of $NumRecords</span>
Please sign in to comment.
Something went wrong with that request. Please try again.