add row controls and delete row button

This commit is contained in:
Max Ogden
2011-08-03 19:33:12 -04:00
parent 8e32984ff3
commit 7cbf23088c
4 changed files with 40 additions and 3 deletions

View File

@@ -27,6 +27,17 @@ var recline = function() {
deleteColumn: function() {
var msg = "Are you sure? This will delete '" + app.currentColumn + "' from all documents.";
if (confirm(msg)) costco.deleteColumn(app.currentColumn);
},
deleteRow: function() {
var doc = _.find(app.cache, function(doc) { return doc._id === app.currentRow });
doc._deleted = true;
costco.uploadDocs([doc]).then(
function(updatedDocs) {
util.notify("Row deleted successfully");
recline.initializeTable(app.offset);
},
function(err) { util.notify("Errorz! " + err) }
)
}
}