From: erickson Date: Mon, 5 Jan 2009 21:28:30 +0000 (+0000) Subject: implemented delete X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e9ac34952e4de9ee4608f7779d653a1a7a3479be;p=evergreen%2Ftadl.git implemented delete git-svn-id: svn://svn.open-ils.org/ILS/trunk@11747 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/ui/default/conify/global/config/hold_matrix_matchpoint.js b/Open-ILS/web/js/ui/default/conify/global/config/hold_matrix_matchpoint.js index 3ad0ea1a29..cceaddcd0b 100644 --- a/Open-ILS/web/js/ui/default/conify/global/config/hold_matrix_matchpoint.js +++ b/Open-ILS/web/js/ui/default/conify/global/config/hold_matrix_matchpoint.js @@ -12,7 +12,7 @@ var marcType = {}; var marcForm = {}; var vrForm = {}; var pcrud = new openils.PermaCrud(); - +var hmCache = []; function getOrgInfo(rowIndex, item) { if(!item) return ''; @@ -136,5 +136,31 @@ function buildHMGrid() { } ); } +function deleteFromGrid() { + _deleteFromGrid(hmGrid.selection.getSelected(), 0); +} + +function _deleteFromGrid(list, idx) { + if(idx >= list.length) // we've made it through the list + return; + + var item = list[idx]; + var id = hmGrid.store.getValue(item, 'id'); + + fieldmapper.standardRequest( + ['open-ils.permacrud', 'open-ils.permacrud.delete.chmm'], + { async: true, + params: [openils.User.authtoken, id], + oncomplete: function(r) { + if(stat = openils.Util.readResponse(r)) { + // delete succeeded, remove it from the grid and the local cache + hmGrid.store.deleteItem(item); + delete hmCache[item.code]; + } + _deleteFromGrid(list, ++idx); + } + } + ); +} openils.Util.addOnLoad(init); \ No newline at end of file