Etemplate: Fix push add to an empty nextmatch would leave the 'No matches found' and throw errors for row actions

This commit is contained in:
nathangray
2020-10-09 10:15:17 -06:00
parent 23aea3b42e
commit 855d6defc9
4 changed files with 27 additions and 4 deletions

View File

@ -467,8 +467,15 @@ export class et2_dataview_controller
this._grid.insertRow(_entry.idx, _entry.row);
}
// Remove 'No matches found' row
var row = jQuery(".egwGridView_empty",this._grid.innerTbody).remove();
if(row.length)
{
this._selectionMgr.unregisterRow("", 0);
}
// Update index map only for push (autorefresh disabled)
if(this._indexMap[_entry.idx].uid !== _entry.uid)
if(this._indexMap[_entry.idx] && this._indexMap[_entry.idx].uid !== _entry.uid)
{
let max = parseInt(Object.keys(this._indexMap).reduce((a, b) => this._indexMap[a] > this._indexMap[b] ? a : b));
for(let idx = max; idx >= _entry.idx; idx--)
@ -481,8 +488,8 @@ export class et2_dataview_controller
this._selectionMgr._registeredRows[entry.uid].idx = entry.idx;
}
}
this._indexMap[_entry.idx] = _entry
}
this._indexMap[_entry.idx] = _entry;
return this.hasData;
}