hooking up last button

This commit is contained in:
Max Ogden
2011-07-01 11:47:13 -07:00
parent a2e734139c
commit 1f34f63f97
3 changed files with 18 additions and 8 deletions

View File

@@ -5,7 +5,9 @@ var removalist = function() {
}
function renderRows(rows) {
var tableRows = [];
rows.map(function(row) {
var cells = [];
app.headers.map(function(header) {
@@ -18,19 +20,22 @@ var removalist = function() {
})
tableRows.push({cells: cells});
})
util.render('dataTable', 'dataTableContainer', {
rows: tableRows,
headers: app.headers
})
app.newest = rows[0].id;
app.oldest = rows[rows.length - 1].id;
}
function getPageSize() {
return parseInt($(".viewpanel-pagesize .selected").text());
}
function fetchRows(id) {
function fetchRows(id, skip) {
var query = {
"limit" : getPageSize()
@@ -41,6 +46,8 @@ var removalist = function() {
if (id !== app.newest) $.extend( query, {"skip": 1});
}
if (skip) $.extend( query, {"skip": skip});
var req = {url: app.baseURL + 'api/rows?' + $.param(query)};
couch.request(req).then(function(response) {