From 715bbf9abeb35b7c8c3645a2f3a7379e14559feb Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 17 Jun 2014 19:23:14 +0000 Subject: [PATCH] If a refresh of a particular UID is requested and server doesn't give it then remove it. Fixes refresh where the row no longer match filters, but is still there. --- phpgwapi/js/jsapi/egw_data.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/phpgwapi/js/jsapi/egw_data.js b/phpgwapi/js/jsapi/egw_data.js index 1bd0598323..783d91579b 100644 --- a/phpgwapi/js/jsapi/egw_data.js +++ b/phpgwapi/js/jsapi/egw_data.js @@ -49,9 +49,6 @@ egw.extend("data", egw.MODULE_APP_LOCAL, function (_app, _wnd) { egw.debug("error", "Invalid result for 'dataFetch'"); } - // The "uidsMissing" contains a list of missing uids. - var uidsMissing = []; - if (_result.lastModification) { lastModification = _result.lastModification; @@ -81,6 +78,18 @@ egw.extend("data", egw.MODULE_APP_LOCAL, function (_app, _wnd) { egw.dataStoreUID(uid, _result.data[key]); } } + + // Tried to refresh a specific row and got nothing, so set it to null + // (triggers update for listeners), then remove it + if(_result.data.length == 0 && typeof _context == "object" && _context.refresh) + { + for(var i = 0; i < _context.refresh.length; i++) + { + var uid = UID(_context.refresh[i], _context.prefix); + egw.dataStoreUID(uid, null); + egw.dataDeleteUID(uid); + } + } // Call the callback function and pass the calculated "order" array // as well as the "total" count and the "timestamp" to the listener.