diff --git a/etemplate/js/et2_dataview_controller.js b/etemplate/js/et2_dataview_controller.js index 44f591eae9..9a7b90e6d8 100644 --- a/etemplate/js/et2_dataview_controller.js +++ b/etemplate/js/et2_dataview_controller.js @@ -753,10 +753,13 @@ var et2_dataview_controller = Class.extend({ // Delete as many rows as we have left, invalidate the corresponding // index entry - for (var i = mapIdx; i < _idxMap.length; i++) + for (var i = mapIdx; i < this._grid._map.length; i++) { - this._grid.deleteRow(idx); - _idxMap[i].uid = null; + this._grid.deleteRow(i); + if(typeof _idxMap[i] != 'undefined') + { + _idxMap[i].uid = null; + } } return result; diff --git a/etemplate/js/et2_dataview_view_grid.js b/etemplate/js/et2_dataview_view_grid.js index 6b22abbfd2..8db44cf7af 100644 --- a/etemplate/js/et2_dataview_view_grid.js +++ b/etemplate/js/et2_dataview_view_grid.js @@ -834,6 +834,8 @@ var et2_dataview_grid = et2_dataview_container.extend(et2_dataview_IViewRange, * containers have to be removed and where new containers should be added. */ _doInvalidate: function(_super) { + if(!this.doInvalidate) return; + // Update the pixel positions this._recalculateElementPosition(); diff --git a/etemplate/js/et2_extension_nextmatch.js b/etemplate/js/et2_extension_nextmatch.js index d63de8a563..f6372bbca5 100644 --- a/etemplate/js/et2_extension_nextmatch.js +++ b/etemplate/js/et2_extension_nextmatch.js @@ -466,21 +466,17 @@ var et2_nextmatch = et2_DOMWidget.extend([et2_IResizeable, et2_IInput], { this.controller._selectionMgr._handleSelect(next.id); } - + // Stop automatic updating + this.dataview.grid.doInvalidate = false; // Blank the row - this.egw().dataStoreUID(uid,null); + this.dataview.grid.deleteRow(entry.idx); // Stop caring about this ID - this.egw().dataUnregisterUID(uid); + this.egw().dataDeleteUID(uid); // Update the count - this.options.settings.total -= 1; - // This removes the last row (in addition), doesn't matter if that wasn't the right one, - // then triggers an invalidate, which may update the grid - // this.dataview.grid.setTotalCount(this.options.settings.total); - // Update directly instead - this.dataview.grid._total = this.options.settings.total; - this.controller._selectionMgr._total = this.options.settings.total; - this.header.count_total.text(this.options.settings.total+""); - + var total = this.dataview.grid._total - 1; + this.dataview.grid.setTotalCount(total); + // Re-enable automatic updating + this.dataview.grid.doInvalidate = true; break; case "edit": case "add":