- $(that.node).html(drawPager(data))
-
- function drawPager(data) {
- var teamName = that.team.name();
- var s = '<div style="float: right">' + M('Displaying') + ': '
- + (data.start + 1) + ' ' + M('to') + ' ' + (data.start + data.num) +
- ' ' + M('of') + ' ' + data.merged + ' (' + M('found') + ': '
- + data.total + ')</div>';
-
- //client indexes pages from 1 but pz2 from 0
- var onsides = 6;
- var pages = Math.ceil(that.team.totalRecordCount() / that.team.perpage());
- var currentPage = that.team.currentPage();
-
- var firstClkbl = (currentPage - onsides > 0)
- ? currentPage - onsides
- : 1;
-
- var lastClkbl = firstClkbl + 2*onsides < pages
- ? firstClkbl + 2*onsides
- : pages;
-
- var prev = '<span class="mkwsPrev"><< ' + M('Prev') + '</span> | ';
- if (currentPage > 1)
- prev = '<a href="#" class="mkwsPrev" onclick="mkws.pagerPrev(\'' + teamName + '\');">'
- +'<< ' + M('Prev') + '</a> | ';
-
- var middle = '';
- for(var i = firstClkbl; i <= lastClkbl; i++) {
- var numLabel = i;
- if(i == currentPage)
- numLabel = '<span class="mkwsCurrentPage">' + i + '</span>';
-
- middle += '<a href="#" onclick="mkws.showPage(\'' + teamName + '\', ' + i + ')"> '
- + numLabel + ' </a>';
+ var teamName = that.team.name();
+ var output = {};
+ output.first = data.start + 1;
+ output.last = data.start + data.num;
+ output.count = data.merged;
+ output.found = data.total;
+
+ //client indexes pages from 1 but pz2 from 0
+ var onsides = 6;
+ var pages = Math.ceil(that.team.totalRecordCount() / that.team.perpage());
+ var currentPage = that.team.currentPage();
+
+ var firstClkbl = (currentPage - onsides > 0)
+ ? currentPage - onsides
+ : 1;
+ var lastClkbl = firstClkbl + 2*onsides < pages
+ ? firstClkbl + 2*onsides
+ : pages;
+
+ if (firstClkbl > 1) output.morePrev = true;
+ if (lastClkbl < pages) output.moreNext = true;
+
+ if (currentPage > 1) output.prevClick = "mkws.pagerPrev(\'" + teamName + "\');";
+
+ output.pages = [];
+ for(var i = firstClkbl; i <= lastClkbl; i++) {
+ var o = {};
+ o.number = i;
+ if (i !== currentPage) {
+ o.click = "mkws.showPage(\'" + teamName + "\', " + i + ");";