From 9d833ba7654f164121a7c02f277df9dfc362bff3 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 26 Jun 2008 14:42:42 +0000 Subject: [PATCH] ebl Permit to delete items from selection with delete key git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7239 91ce42f0-d328-0410-95d8-f526ca767f89 --- gui/bweb/html/bresto.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/gui/bweb/html/bresto.js b/gui/bweb/html/bresto.js index 87f2b2858d..fc2661e76a 100644 --- a/gui/bweb/html/bresto.js +++ b/gui/bweb/html/bresto.js @@ -352,19 +352,21 @@ function ext_init() }}); file_selection_grid.on('enddrag', function(dd,e) { - alert(e) ; return true; + alert('enddrag'); alert(e) ; return true; }); file_selection_grid.on('notifyDrop', function(dd,e) { - alert(e) ; return true; + alert('notifyDrop'); alert(e) ; return true; }); func1 = function(e,b,c) { - if (e.browserEvent.keyCode == 46) { - for (elt in file_selection_grid.getSelectionModel().getSelections()) { - alert(elt); -// file_selection_store.remove(elt); - } - } - }; + if (e.browserEvent.keyCode == 46) { + var m = file_selection_grid.getSelections(); + if(m.length > 0) { + for(var i = 0, len = m.length; i < len; i++){ + file_selection_store.remove(m[i]); + } + } + } + }; file_selection_grid.on('keypress', func1); /////////////////////////////////////////////////////// -- 2.39.5