Browse Source

UI: support always show for grid toolbar buttons

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 11 months ago
parent
commit
eea72db472
2 changed files with 2 additions and 1 deletions
  1. 1 1
      client/src/components/grid/ToolBar.tsx
  2. 1 0
      client/src/components/grid/Types.ts

+ 1 - 1
client/src/components/grid/ToolBar.tsx

@@ -72,7 +72,7 @@ const CustomToolBar: FC<ToolBarType> = props => {
             const Icon = c.icon ? Icons[c.icon!]() : '';
             const disabled = c.disabled ? c.disabled(selected) : false;
 
-            if (disabled && hideOnDisable) {
+            if (disabled && hideOnDisable && !c.alwaysShow) {
               return null;
             }
             // when disabled "disabledTooltip" will replace "tooltip"

+ 1 - 0
client/src/components/grid/Types.ts

@@ -50,6 +50,7 @@ export type ToolBarConfig = Partial<TableSwitchType> &
     component?: ReactElement;
     btnVariant?: 'contained' | 'outlined' | 'text';
     btnColor?: 'primary' | 'secondary';
+    alwaysShow?: boolean;
   };
 
 export type TableHeadType = {