From 6fe1d935d495866a19dc35f9b875878aac5fdf71 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 28 Aug 2014 12:13:45 +0000 Subject: [PATCH] when nextmatch queries children, querying controller has no filters, so we have to use the ones from its parent --- .../js/et2_extension_nextmatch_controller.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/etemplate/js/et2_extension_nextmatch_controller.js b/etemplate/js/et2_extension_nextmatch_controller.js index fecf928a67..1c2a6fc439 100644 --- a/etemplate/js/et2_extension_nextmatch_controller.js +++ b/etemplate/js/et2_extension_nextmatch_controller.js @@ -146,16 +146,16 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider, */ deleteRow: function(uid) { var entry = this._selectionMgr._getRegisteredRowsEntry(uid); - + // Unselect this._selectionMgr.setSelected(uid,false); - + if(entry && entry.idx !== null) { // This will remove the row, but add an empty to the end. // That's OK, because it will be removed when we update the row count this._grid.deleteRow(entry.idx); - + // Trigger controller to remove from internals this.egw.dataStoreUID(uid,null); // Stop caring about this ID @@ -421,12 +421,19 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider, _queriedRange["parent_id"] = this._parentId; } + // sub-levels dont have there own _filters object, need to use the one from parent (or it's parents parent) + var obj = this; + while((typeof obj._filters == 'undefined' || jQuery.isEmptyObject(obj._filters)) && obj._parentController) + { + obj = obj._parentController; + } + // Pass the fetch call to the API, multiplex the data about the // nextmatch instance into the call. this.egw.dataFetch( this._widget.getInstanceManager().etemplate_exec_id || this._execId, _queriedRange, - this._filters, + obj._filters, this._widgetId, _callback, _context);