To test:
1) Apply this commit.
2) Create an eg-grid in the Angular staff client without a persistKey
attribute (or use the one in the sandbox).
3) Compile the client and open the grid in your browser. Open the
column picker menu. Note that the Save button does not display.
4) Add an arbitrary value to the persistKey attribute.
5) Repeat step 3. Note that the Save button does display.
6) Change the value of the persistKey attribute to "disabled".
7) Repeat step 3. Note that the Save button does not display.
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
<span class="ml-2" i18n>Manage Column Widths</span>
</a>
<a class="dropdown-item label-with-material-icon"
+ *ngIf="!disableSaveSettings"
(click)="saveGridConfig()">
<span class="material-icons">save</span>
<span class="ml-2" i18n>Save Grid Settings</span>
@Input() gridContext: GridContext;
@Input() colWidthConfig: GridColumnWidthComponent;
@Input() gridPrinter: GridPrintComponent;
+ @Input() disableSaveSettings = false;
renderedGroups: {[group: string]: boolean};
<eg-grid-toolbar
[gridContext]="context"
[gridPrinter]="gridPrinter"
- [colWidthConfig]="colWidthConfig">
+ [colWidthConfig]="colWidthConfig"
+ [disableSaveSettings]="!persistKey || ('disabled' === persistKey)">
</eg-grid-toolbar>
<eg-grid-header [context]="context"></eg-grid-header>
// Storage persist key / per-grid-type unique identifier
// The value is prefixed with 'eg.grid.'
+ //
+ // If persistKey is set to "disabled", or does not exist,
+ // the grid will not display a Save button to the user
@Input() persistKey: string;
@Input() disableSelect: boolean;