I use jquery pagination plugin for paging... If there is one pagination plugin there is no problem for me... But if there is two one seems to work but the other doesn't seem too... Here is my code,
<div id="PagerUp" class="pager">
</div><br /><br /><br />
<div id="ResultsDiv">
</div>
<div id="PagerDown" class="pager">
</div>
And my jquery has,
<script type="text/javascript">
var itemsPerPage = 5;
$(document).ready(function() {
getRecordspage(0, itemsPerPage);
var maxvalues = $("#HfId").val();
$(".pager").pagination(maxvalues, {
callback: getRecordspage,
current_page: 0,
items_per_page: itemsPerPage,
num_display_entries: 5,
next_text: 'Next',
prev_text: 'Prev',
num_edge_entries: 1
});
});
</script>
Here is what i am getting...
Both works but Look at the pagerup
the selected page is 3
but the PagerDown
shows 1
.... How to change one pager on other pagers callback event in jquery....
EDIT: using mef's idea doesn't seem to work...
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="jquery.js"></script>
<link rel="Stylesheet" type="text/css" href="CSS/Main.css" />
<script type="text/javascript" src="Javascript/jquery.pagination.js">
</script>
<script type="text/javascript">
$(document).ready(function() {
$(".pager").pagination(300, { callback: pagecallback,
current_page: 0,
items_per_page: 5,
num_display_entries: 5,
next_text: 'Next',
prev_text: 'Prev',
num_edge_entries: 1
});
});
function pagecallback() {
var paginationClone = $("#Pagination > *").clone(true);
$("#Pagination2").empty();
paginationClone.appendTo("#Pagination2");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div class="pager" id="pagination">
<!-- the container for your first pagination area -->
</div>
<div id="results">
<!-- the container where you show your results -->
</div>
<div class="pager" id="Pagination2">
<!-- the container for your second pagination area -->
</div>
</div>
</form>
</body>
</html>