mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Etemplate: Fix another bug in refresh / add / update
This one was found in Infolog, adding a sub to an entry with the show-subs preference set to only while filtering. The row count would be off by one if the new entry did not match the filter.
This commit is contained in:
parent
eb812dad01
commit
df57ea914e
@ -605,8 +605,6 @@ var et2_nextmatch = /** @class */ (function (_super) {
|
|||||||
if (index === false) {
|
if (index === false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Increase displayed row count
|
|
||||||
this.controller._grid.setTotalCount(this.controller._grid.getTotalCount() + 1);
|
|
||||||
// Insert at the top of the list, or where app said
|
// Insert at the top of the list, or where app said
|
||||||
var entry = this.controller._selectionMgr._getRegisteredRowsEntry(uid);
|
var entry = this.controller._selectionMgr._getRegisteredRowsEntry(uid);
|
||||||
entry.idx = typeof index == "number" ? index : 0;
|
entry.idx = typeof index == "number" ? index : 0;
|
||||||
@ -614,7 +612,11 @@ var et2_nextmatch = /** @class */ (function (_super) {
|
|||||||
// Set "new entry" class - but it has to stay so register and re-add it after the data is there
|
// Set "new entry" class - but it has to stay so register and re-add it after the data is there
|
||||||
entry.row.tr.addClass("new_entry");
|
entry.row.tr.addClass("new_entry");
|
||||||
var callback = function (data) {
|
var callback = function (data) {
|
||||||
|
if (data && data.class) {
|
||||||
data.class += " new_entry";
|
data.class += " new_entry";
|
||||||
|
// Increase displayed row count
|
||||||
|
this.controller._grid.setTotalCount(this.controller._grid.getTotalCount() + 1);
|
||||||
|
}
|
||||||
this.egw().dataUnregisterUID(uid, callback, this);
|
this.egw().dataUnregisterUID(uid, callback, this);
|
||||||
};
|
};
|
||||||
this.egw().dataRegisterUID(uid, callback, this, this.getInstanceManager().etemplate_exec_id, this.id);
|
this.egw().dataRegisterUID(uid, callback, this, this.getInstanceManager().etemplate_exec_id, this.id);
|
||||||
|
@ -907,8 +907,6 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Increase displayed row count
|
|
||||||
this.controller._grid.setTotalCount(this.controller._grid.getTotalCount()+1);
|
|
||||||
|
|
||||||
// Insert at the top of the list, or where app said
|
// Insert at the top of the list, or where app said
|
||||||
var entry = this.controller._selectionMgr._getRegisteredRowsEntry(uid);
|
var entry = this.controller._selectionMgr._getRegisteredRowsEntry(uid);
|
||||||
@ -918,7 +916,13 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
|
|||||||
// Set "new entry" class - but it has to stay so register and re-add it after the data is there
|
// Set "new entry" class - but it has to stay so register and re-add it after the data is there
|
||||||
entry.row.tr.addClass("new_entry");
|
entry.row.tr.addClass("new_entry");
|
||||||
let callback = function(data) {
|
let callback = function(data) {
|
||||||
|
if(data && data.class)
|
||||||
|
{
|
||||||
data.class += " new_entry";
|
data.class += " new_entry";
|
||||||
|
|
||||||
|
// Increase displayed row count
|
||||||
|
this.controller._grid.setTotalCount(this.controller._grid.getTotalCount()+1);
|
||||||
|
}
|
||||||
this.egw().dataUnregisterUID(uid, callback, this);
|
this.egw().dataUnregisterUID(uid, callback, this);
|
||||||
};
|
};
|
||||||
this.egw().dataRegisterUID(uid, callback, this, this.getInstanceManager().etemplate_exec_id, this.id);
|
this.egw().dataRegisterUID(uid, callback, this, this.getInstanceManager().etemplate_exec_id, this.id);
|
||||||
|
Loading…
Reference in New Issue
Block a user