mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 23:00:56 +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 columnMgr = this.dataview.getColumnMgr();
|
||||||
const visibility = {};
|
const visibility = {};
|
||||||
|
let need_reload = false;
|
||||||
|
|
||||||
// Initialize to false
|
// Initialize to false
|
||||||
for(var i = 0; i < columnMgr.columns.length; i++)
|
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);
|
(<et2_nextmatch_customfields><unknown>widget).set_visible(visible);
|
||||||
}
|
}
|
||||||
this.columns[i].visible = visibility[columnMgr.columns[i].id].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);
|
columnMgr.setColumnVisibilitySet(visibility);
|
||||||
|
|
||||||
// We don't want to update user's preference, so directly update
|
// We don't want to update user's preference, so directly update
|
||||||
|
Loading…
Reference in New Issue
Block a user