// Note most input fields should match class fields for GridColumn
@Input() label: string;
+ // These are optional labels that can come before and after the button
+ @Input() adjacentPreceedingLabel: string = '';
+ @Input() adjacentSubsequentLabel: string = '';
+
// Register to click events
@Output() onClick: EventEmitter<any>;
this.button.onClick = this.onClick;
this.button.routerLink = this.routerLink;
this.button.label = this.label;
+ this.button.adjacentPreceedingLabel = this.adjacentPreceedingLabel;
+ this.button.adjacentSubsequentLabel = this.adjacentSubsequentLabel;
this.button.action = this.action;
this.grid.context.toolbarButtons.push(this.button);
}
[disabled]="!gridContext.filtersSet() || gridContext.dataSource.requestingData" i18n>
Remove Filters
</button>
- <button *ngFor="let btn of gridContext.toolbarButtons"
- [disabled]="btn.disabled"
- class="btn btn-outline-dark me-1" (click)="performButtonAction(btn)">
- {{btn.label}}
- </button>
+ <ng-container *ngFor="let btn of gridContext.toolbarButtons">
+ <label
+ *ngIf="btn.adjacentPreceedingLabel"
+ [ngClass]="{'button-adjacent-label':true,'disabled':btn.disabled}">
+ {{btn.adjacentPreceedingLabel}}
+ </label>
+ <button
+ [disabled]="btn.disabled"
+ class="btn btn-outline-dark me-1" (click)="performButtonAction(btn)">
+ {{btn.label}}
+ </button>
+ <label
+ *ngIf="btn.adjacentSubsequentLabel"
+ [ngClass]="{'button-adjacent-label':true,'disabled':btn.disabled}">
+ {{btn.adjacentSubsequentLabel}}
+ </label>
+ </ng-container>
</div>
<!-- checkboxes -->
padding-bottom: 11px;
}
+.button-adjacent-label {
+ vertical-align: inherit;
+ cursor: auto;
+}
+
+.button-adjacent-label.disabled {
+ opacity: .65;
+}
+
.eg-grid-cell-skinny {
width: 2em;
text-align: center;
// Buttons are global actions
export class GridToolbarButton {
label: string;
+ adjacentPreceedingLabel: string;
+ adjacentSubsequentLabel: string;
onClick: EventEmitter<any []>;
action: () => any; // DEPRECATED
disabled: boolean;