From 29b2f1f210c2d07d704ad3f32cb8d20e876050bf Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 11 May 2015 08:56:07 +0000 Subject: [PATCH] Reset kept_selection if selected rows from response are no longer available. (e.g. select all mail in a folder and delete them) --- etemplate/js/et2_extension_nextmatch_controller.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_extension_nextmatch_controller.js b/etemplate/js/et2_extension_nextmatch_controller.js index dde1fa7694..88b92653da 100644 --- a/etemplate/js/et2_extension_nextmatch_controller.js +++ b/etemplate/js/et2_extension_nextmatch_controller.js @@ -573,6 +573,10 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider, this.self._selectionMgr.setSelected(this.self.kept_selection.ids[i],true); this.self.kept_selection.ids.splice(i,1); } + else + { + this.self.kept_selection.ids.splice(i,1); + } } if(this.self.kept_focus && _response.order.indexOf(this.self.kept_focus) >= 0) { @@ -580,7 +584,7 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider, } // Re-expanding rows handled in et2_extension_nextmatch_rowProvider // Expansions might still be valid, so we don't clear them - if(this.self.kept_selection != null && this.self.kept_selection.length == 0) + if(this.self.kept_selection != null && typeof this.self.kept_selection.ids != 'undefined' && this.self.kept_selection.ids.length == 0) { this.self.kept_selection = null; }