Api: Fix nm columnselection still showed disabled columns

This commit is contained in:
nathan 2023-07-12 15:08:31 -06:00
parent b33f41c8b2
commit e6f142c7a4
2 changed files with 11 additions and 5 deletions

View File

@ -132,13 +132,19 @@ export class Et2ColumnSelection extends Et2InputWidget(LitElement)
*/
protected rowTemplate(column) : TemplateResult
{
let isCustom = column.widget?.instanceOf(et2_nextmatch_customfields) || false;
/* ?disabled=${column.visibility == et2_dataview_column.ET2_COL_VISIBILITY_DISABLED} */
const isCustom = column.widget?.instanceOf(et2_nextmatch_customfields) || false;
const alwaysOn = [et2_dataview_column.ET2_COL_VISIBILITY_ALWAYS, et2_dataview_column.ET2_COL_VISIBILITY_ALWAYS_NOSELECT].indexOf(column.visibility) !== -1;
// Don't show disabled columns
if(column.visibility == et2_dataview_column.ET2_COL_VISIBILITY_DISABLED)
{
return html``;
}
return html`
<sl-menu-item
value="${column.id}"
?checked=${column.visibility == et2_dataview_column.ET2_COL_VISIBILITY_VISIBLE}
?checked=${alwaysOn || column.visibility == et2_dataview_column.ET2_COL_VISIBILITY_VISIBLE}
?disabled=${alwaysOn}
title="${column.title}"
class="${classMap({
select_row: true,

View File

@ -1991,7 +1991,7 @@ export class et2_nextmatch extends et2_DOMWidget implements et2_IResizeable, et2
columns.push({
id: LETTERS,
caption: this.egw().lang('Search letter'),
visibility: (this.header.lettersearch.is(':visible') ? et2_dataview_column.ET2_COL_VISIBILITY_VISIBLE : et2_dataview_column.ET2_COL_VISIBILITY_ALWAYS_NOSELECT)
visibility: (this.header.lettersearch.is(':visible') ? et2_dataview_column.ET2_COL_VISIBILITY_VISIBLE : et2_dataview_column.ET2_COL_VISIBILITY_INVISIBLE)
});
}