trigger full refresh / applyFilters, if app refresh_add returns false

This commit is contained in:
Ralf Becker 2020-07-22 16:58:21 +02:00
parent d9ff68a422
commit 32043f7a41
2 changed files with 11 additions and 6 deletions

View File

@ -511,8 +511,9 @@ var et2_nextmatch = /** @class */ (function (_super) {
// Handled above, more code to execute after loop
break;
case "add":
this.refresh_add(uid);
break;
if (this.refresh_add(uid))
break;
// fall-through / full refresh, if refresh_add returns false
case "edit":
default:
// Trigger refresh
@ -527,6 +528,7 @@ var et2_nextmatch = /** @class */ (function (_super) {
* An entry has been added. Put it in the list.
*
* @param uid
* @return boolean false: not added, true: added
*/
et2_nextmatch.prototype.refresh_add = function (uid) {
var index = 0;
@ -537,7 +539,7 @@ var et2_nextmatch = /** @class */ (function (_super) {
}
// App cancelled the add
if (index === false) {
return;
return false;
}
// Insert at the top of the list, or where app said
var entry = this.controller._selectionMgr._getRegisteredRowsEntry(uid);
@ -550,6 +552,7 @@ var et2_nextmatch = /** @class */ (function (_super) {
this.egw().dataUnregisterUID(uid, callback, this);
};
this.egw().dataRegisterUID(uid, callback, this, this.getInstanceManager().etemplate_exec_id, this.id);
return true;
};
et2_nextmatch.prototype._get_appname = function () {
var app = '';

View File

@ -777,8 +777,8 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
// Handled above, more code to execute after loop
break;
case "add":
this.refresh_add(uid);
break;
if (this.refresh_add(uid)) break;
// fall-through / full refresh, if refresh_add returns false
case "edit":
default:
// Trigger refresh
@ -794,6 +794,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
* An entry has been added. Put it in the list.
*
* @param uid
* @return boolean false: not added, true: added
*/
protected refresh_add(uid:string)
{
@ -808,7 +809,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
// App cancelled the add
if(index === false)
{
return;
return false;
}
// Insert at the top of the list, or where app said
@ -823,6 +824,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
this.egw().dataUnregisterUID(uid, callback, this);
};
this.egw().dataRegisterUID(uid, callback, this, this.getInstanceManager().etemplate_exec_id, this.id);
return true;
}
private _get_appname()