Etemplate: Fix nextmatch controller destroy() left some references

AJAX responses would then try to use them after the etemplate was destroyed, and fail.
This commit is contained in:
nathangray
2020-11-09 09:44:40 -07:00
parent 2f40337f81
commit 1ba23feb9c
4 changed files with 22 additions and 2 deletions

View File

@ -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")