mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Api: Show nm columns from favourites, automatically reloading if needed to get missing columns
This commit is contained in:
parent
efe0eff776
commit
e24b5578a3
@ -2180,6 +2180,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
|
||||
{
|
||||
const columnMgr = this.dataview.getColumnMgr();
|
||||
const visibility = {};
|
||||
let need_reload = false;
|
||||
|
||||
// Initialize to false
|
||||
for(var i = 0; i < columnMgr.columns.length; i++)
|
||||
@ -2230,7 +2231,21 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
|
||||
(<et2_nextmatch_customfields><unknown>widget).set_visible(visible);
|
||||
}
|
||||
this.columns[i].visible = visibility[columnMgr.columns[i].id].visible;
|
||||
|
||||
if(this.dataview.rowProvider._columnIds.indexOf(columnMgr.columns[i].id) == -1)
|
||||
{
|
||||
need_reload = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(need_reload)
|
||||
{
|
||||
// We need to change preferences and reload to get columns that were hidden during the first load
|
||||
this.dataview.updateColumns();
|
||||
this.getInstanceManager().submit();
|
||||
return;
|
||||
}
|
||||
|
||||
columnMgr.setColumnVisibilitySet(visibility);
|
||||
|
||||
// We don't want to update user's preference, so directly update
|
||||
|
Loading…
Reference in New Issue
Block a user