diff --git a/api/js/etemplate/et2_dataview_controller.js b/api/js/etemplate/et2_dataview_controller.js index 5e71e745c8..3d02e0ab54 100644 --- a/api/js/etemplate/et2_dataview_controller.js +++ b/api/js/etemplate/et2_dataview_controller.js @@ -87,6 +87,7 @@ var et2_dataview_controller = /** @class */ (function () { this._parentController = null; } } + this._grid = null; }; /** * @param value is an object implementing the et2_IDataProvider @@ -124,6 +125,10 @@ var et2_dataview_controller = /** @class */ (function () { * Completely clears the grid and selection. */ et2_dataview_controller.prototype.update = function (clear) { + // Avoid update after destroy + // Happens sometimes if AJAX response comes after etemplate unload + if (!this._grid) + return; // --------- // TODO: Actually stuff here should be done if the server responds that // there at all were some changes (needs implementation of "refresh") diff --git a/api/js/etemplate/et2_dataview_controller.ts b/api/js/etemplate/et2_dataview_controller.ts index ffdfb37e9e..a7080424fe 100644 --- a/api/js/etemplate/et2_dataview_controller.ts +++ b/api/js/etemplate/et2_dataview_controller.ts @@ -131,6 +131,8 @@ export class et2_dataview_controller this._parentController = null; } } + + this._grid = null; } /** @@ -186,6 +188,9 @@ export class et2_dataview_controller */ update( clear? : boolean) { + // Avoid update after destroy + // Happens sometimes if AJAX response comes after etemplate unload + if(!this._grid) return; // --------- diff --git a/api/js/etemplate/et2_extension_nextmatch_controller.js b/api/js/etemplate/et2_extension_nextmatch_controller.js index 1ce78b35d9..b6ea69e54f 100644 --- a/api/js/etemplate/et2_extension_nextmatch_controller.js +++ b/api/js/etemplate/et2_extension_nextmatch_controller.js @@ -40,6 +40,8 @@ var __extends = (this && this.__extends) || (function () { Object.defineProperty(exports, "__esModule", { value: true }); var et2_dataview_view_row_1 = require("./et2_dataview_view_row"); var et2_dataview_view_tile_1 = require("./et2_dataview_view_tile"); +var et2_dataview_controller_1 = require("./et2_dataview_controller"); +var et2_dataview_model_columns_1 = require("./et2_dataview_model_columns"); /** * @augments et2_dataview_controller */ @@ -123,6 +125,7 @@ var et2_nextmatch_controller = /** @class */ (function (_super) { this._objectManager.remove(); this._actionManager.remove(); } + this._widget = null; _super.prototype.destroy.call(this); }; /** @@ -535,7 +538,7 @@ var et2_nextmatch_controller = /** @class */ (function (_super) { col_refresh = true; nm.dataview.columnMgr.getColumnById('col_' + column_index) .set_visibility(nm.getArrayMgr('content').parseBoolExpression(nm.columns[column_index].disabled) ? - et2_dataview_column.ET2_COL_VISIBILITY_DISABLED : + et2_dataview_model_columns_1.et2_dataview_column.ET2_COL_VISIBILITY_DISABLED : nm.columns[column_index].visible); } } @@ -621,6 +624,6 @@ var et2_nextmatch_controller = /** @class */ (function (_super) { et2_nextmatch_controller.VIEW_ROW = 'row'; et2_nextmatch_controller.VIEW_TILE = 'tile'; return et2_nextmatch_controller; -}(et2_dataview_controller)); +}(et2_dataview_controller_1.et2_dataview_controller)); exports.et2_nextmatch_controller = et2_nextmatch_controller; //# sourceMappingURL=et2_extension_nextmatch_controller.js.map \ No newline at end of file diff --git a/api/js/etemplate/et2_extension_nextmatch_controller.ts b/api/js/etemplate/et2_extension_nextmatch_controller.ts index d205d1bc69..33080a4fe1 100644 --- a/api/js/etemplate/et2_extension_nextmatch_controller.ts +++ b/api/js/etemplate/et2_extension_nextmatch_controller.ts @@ -27,6 +27,9 @@ import {et2_IDataProvider} from "./et2_dataview_interfaces"; import {et2_dataview_row} from "./et2_dataview_view_row"; import {et2_dataview_tile} from "./et2_dataview_view_tile"; +import {et2_nextmatch} from "./et2_extension_nextmatch"; +import {et2_dataview_controller} from "./et2_dataview_controller"; +import {et2_dataview_column} from "./et2_dataview_model_columns"; /** * @augments et2_dataview_controller @@ -37,6 +40,8 @@ export class et2_nextmatch_controller extends et2_dataview_controller implements public static readonly VIEW_ROW : string = 'row'; public static readonly VIEW_TILE: string = 'tile'; + private _widget: et2_nextmatch; + /** * Initializes the nextmatch controller. * @@ -139,6 +144,8 @@ export class et2_nextmatch_controller extends et2_dataview_controller implements this._actionManager.remove(); } + this._widget = null; + super.destroy(); }