From 74edbe227d90cf32941ef84cb4ba1ed925169009 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 16 Jul 2018 16:17:36 -0600 Subject: [PATCH] Fix bug where nextmatch selection manager was holding onto selected rows --- api/js/etemplate/et2_dataview_controller.js | 3 +++ api/js/etemplate/et2_dataview_controller_selection.js | 8 ++++++++ api/js/etemplate/et2_extension_nextmatch.js | 3 +++ 3 files changed, 14 insertions(+) diff --git a/api/js/etemplate/et2_dataview_controller.js b/api/js/etemplate/et2_dataview_controller.js index 83ce1bdfca..abaa7ce80f 100644 --- a/api/js/etemplate/et2_dataview_controller.js +++ b/api/js/etemplate/et2_dataview_controller.js @@ -147,6 +147,9 @@ var et2_dataview_controller = (function(){ "use strict"; return Class.extend({ // Free selection manager this._selectionMgr.clear(); + + // Clear object manager + this._objectManager.clear(); // Clear the map this._indexMap = {} diff --git a/api/js/etemplate/et2_dataview_controller_selection.js b/api/js/etemplate/et2_dataview_controller_selection.js index 277bc929ee..8caf0ed989 100644 --- a/api/js/etemplate/et2_dataview_controller_selection.js +++ b/api/js/etemplate/et2_dataview_controller_selection.js @@ -108,6 +108,10 @@ var et2_dataview_selectionManager = (function(){ "use strict"; return Class.exte this.unregisterRow(key, this._registeredRows[key].tr); delete this._registeredRows[key]; } + if(this._actionObjectManager) + { + this._actionObjectManager.clear(); + } this._indexMap = {}; this._total = 0; this._focusedEntry = null; @@ -234,6 +238,10 @@ var et2_dataview_selectionManager = (function(){ "use strict"; return Class.exte this._selectAll = true; + if(Object.keys(this._registeredRows).length != this._total) + { + this._selectRange(0, this._total); + } // Tell action manager to do all this._actionObjectManager.setAllSelected(true); diff --git a/api/js/etemplate/et2_extension_nextmatch.js b/api/js/etemplate/et2_extension_nextmatch.js index 43ceaaf5c8..9458792187 100644 --- a/api/js/etemplate/et2_extension_nextmatch.js +++ b/api/js/etemplate/et2_extension_nextmatch.js @@ -489,6 +489,7 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_ changed = true; keep_selection = true; this.controller._selectionMgr.resetSelection(); + this.controller._objectManager.clear(); for(var i in _set.selected) { this.controller._selectionMgr.setSelected(_set.selected[i].indexOf('::') > 0 ? _set.selected[i] : this.controller.dataStorePrefix + '::'+_set.selected[i],true); @@ -514,6 +515,8 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_ { // Do not keep selection this.controller._selectionMgr.resetSelection(); + this.controller._objectManager.clear(); + this.controller.keepSelection(); } // Update the filters in the grid controller