Fix some nextmatch bugs

- Removed rows could still have jQuery actions bound, resulting in errors
- Focused row was not cleared if it was removed, resulting in errors
- Fixed double get_rows call on refresh(..., update)
This commit is contained in:
nathangray 2020-08-08 10:51:39 -06:00
parent 6567e39668
commit 036ec20769
5 changed files with 13 additions and 13 deletions

View File

@ -340,7 +340,8 @@ function egwPopupActionImplementation()
ai.doUnregisterAction = function(_aoi)
{
//
var node = _aoi.getDOMNode();
jQuery(node).off();
};
/**

View File

@ -133,6 +133,11 @@ var et2_dataview_selectionManager = /** @class */ (function () {
if (typeof this._registeredRows[_uid] !== "undefined"
&& this._registeredRows[_uid].tr === _tr) {
this._inUpdate = true;
// Don't leave focusedEntry
// @ts-ignore
if (this._focusedEntry !== null && this._focusedEntry.uid == _uid) {
this.setFocused(_uid, false);
}
this._registeredRows[_uid].tr = null;
this._registeredRows[_uid].aoi = null;
// Remove the action object from its container

View File

@ -194,6 +194,12 @@ export class et2_dataview_selectionManager
{
this._inUpdate = true;
// Don't leave focusedEntry
// @ts-ignore
if(this._focusedEntry !== null && this._focusedEntry.uid == _uid)
{
this.setFocused(_uid, false);
}
this._registeredRows[_uid].tr = null;
this._registeredRows[_uid].aoi = null;

View File

@ -567,11 +567,6 @@ var et2_nextmatch = /** @class */ (function (_super) {
* @param uid
*/
et2_nextmatch.prototype.refresh_update = function (uid) {
if (!this.egw().dataRefreshUID(uid)) {
// Could not update just that row
this.applyFilters();
return false;
}
// Row data update has been sent, let's move it where app wants it
var entry = this.controller._selectionMgr._getRegisteredRowsEntry(uid);
// Need to delete first as there's a good chance indexes will change in an unknown way

View File

@ -858,13 +858,6 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
*/
protected refresh_update(uid: string)
{
if(!this.egw().dataRefreshUID(uid))
{
// Could not update just that row
this.applyFilters();
return false;
}
// Row data update has been sent, let's move it where app wants it
let entry = this.controller._selectionMgr._getRegisteredRowsEntry(uid);