* All apps: fix last rows was removed when adding new entry to list with only a couple of rows

see ticket #48204, we do a full refresh now to work around this issue until we have a real fix
This commit is contained in:
Ralf Becker 2020-08-17 12:15:40 +02:00
parent f3326a3cc8
commit cf83de93fc
4 changed files with 28 additions and 1 deletions

View File

@ -277,6 +277,12 @@ var et2_dataview_controller = /** @class */ (function () {
} }
return row; return row;
}; };
/**
* Returns the current "total" count.
*/
et2_dataview_controller.prototype.getTotalCount = function () {
return this._grid.getTotalCount();
};
/* -- PRIVATE FUNCTIONS -- */ /* -- PRIVATE FUNCTIONS -- */
et2_dataview_controller.prototype._getIndexEntry = function (_idx) { et2_dataview_controller.prototype._getIndexEntry = function (_idx) {
// Create an entry in the index map if it does not exist yet // Create an entry in the index map if it does not exist yet

View File

@ -23,6 +23,7 @@
import {et2_IDataProvider} from "./et2_dataview_interfaces"; import {et2_IDataProvider} from "./et2_dataview_interfaces";
import {et2_dataview_selectionManager} from "./et2_dataview_controller_selection"; import {et2_dataview_selectionManager} from "./et2_dataview_controller_selection";
import {et2_dataview_row} from "./et2_dataview_view_row"; import {et2_dataview_row} from "./et2_dataview_view_row";
import {et2_dataview_grid} from "./et2_dataview_view_grid";
/** /**
* The fetch timeout specifies the time during which the controller tries to * The fetch timeout specifies the time during which the controller tries to
@ -43,7 +44,7 @@ export class et2_dataview_controller
public static readonly CONCURRENT_REQUESTS = 5; public static readonly CONCURRENT_REQUESTS = 5;
private _parentController: any; private _parentController: any;
private _grid: any; private _grid: et2_dataview_grid;
private dataStorePrefix: any; private dataStorePrefix: any;
private _dataProvider: any; private _dataProvider: any;
private _rowCallback: any; private _rowCallback: any;
@ -390,6 +391,14 @@ export class et2_dataview_controller
return row; return row;
} }
/**
* Returns the current "total" count.
*/
getTotalCount() : number
{
return this._grid.getTotalCount();
}
/* -- PRIVATE FUNCTIONS -- */ /* -- PRIVATE FUNCTIONS -- */

View File

@ -595,6 +595,11 @@ var et2_nextmatch = /** @class */ (function (_super) {
if (type === void 0) { type = et2_nextmatch.ADD; } if (type === void 0) { type = et2_nextmatch.ADD; }
var index = egw.preference("lazy-update") == "lazy" ? 0 : var index = egw.preference("lazy-update") == "lazy" ? 0 :
(this.is_sorted_by_modified() ? 0 : false); (this.is_sorted_by_modified() ? 0 : false);
// workaround for datagrid deleting the last row, see ticket #48204
// if we only have a couple of rows, do a full refresh instead
if (this.controller.getTotalCount() < 15) {
return false;
}
// No add, do a full refresh // No add, do a full refresh
if (index === false) { if (index === false) {
return false; return false;

View File

@ -892,6 +892,13 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
let index : boolean | number = egw.preference("lazy-update") == "lazy" ? 0 : let index : boolean | number = egw.preference("lazy-update") == "lazy" ? 0 :
(this.is_sorted_by_modified() ? 0 : false); (this.is_sorted_by_modified() ? 0 : false);
// workaround for datagrid deleting the last row, see ticket #48204
// if we only have a couple of rows, do a full refresh instead
if (this.controller.getTotalCount() < 15)
{
return false;
}
// No add, do a full refresh // No add, do a full refresh
if(index === false) if(index === false)
{ {