Skip to content

Commit

Permalink
* dtable: skip to show hide action for required col.
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed Jul 8, 2024
1 parent d6342b8 commit 0a53e12
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/dtable/src/plugins/custom-col/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export interface DTableCustomColTypes {
onSetColBorder?: (this: DTableCustomCol, colName: ColName, border: ColBorderType, colBorders: Record<ColName, ColBorderType>) => void;
onSetColVisibility?: (this: DTableCustomCol, colName: ColName, visible: boolean) => void;
},
col: {
required?: boolean;
},
state: {
colBorders: Record<ColName, ColBorderType>;
colVisibility: Record<ColName, boolean>;
Expand Down Expand Up @@ -87,7 +90,7 @@ const customColPlugin: DTablePlugin<DTableCustomColTypes, [DTableContextMenuType
{
text: this.i18n('hideCol'),
icon: 'eye-off',
disabled: !this.options.canSetColVisibility?.call(this, info.colName, false),
disabled: (this.getColInfo(info.colName)?.setting.required as boolean) || !this.options.canSetColVisibility?.call(this, info.colName, false),
onClick: () => this.setColVisibility(info.colName, false),
},
];
Expand Down

0 comments on commit 0a53e12

Please sign in to comment.