FEATURE: Input box for going to a page in gridfield

This commit is contained in:
Andrew O'Neil 2012-03-08 14:11:09 +13:00
parent 38db2c1744
commit 4ad7e8ef8d
2 changed files with 15 additions and 1 deletions

View File

@ -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 File

@ -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>