#58 - add ability to pin database column left or right
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Garrett Mills 2021-01-25 22:00:53 -06:00
parent d2bc04803d
commit bd69f0814d
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246
3 changed files with 32 additions and 0 deletions

View File

@ -48,6 +48,25 @@
<ion-button fill="outline" color="light" (click)="onDeleteClick(i)"> <ion-button fill="outline" color="light" (click)="onDeleteClick(i)">
<ion-icon color="danger" name="trash"></ion-icon> <ion-icon color="danger" name="trash"></ion-icon>
</ion-button> </ion-button>
<ion-button
fill="outline"
color="light"
(click)="iteratePin(i)"
[title]="columnSets[i].additionalData.pinned ? 'Column is pinned to the ' + columnSets[i].additionalData.pinned : 'Column is not pinned'"
>
<i
class="fa fa-caret-square-left"
style="font-size: 1.7em; color: #cccccc" *ngIf="columnSets[i].additionalData.pinned === 'left'"
></i>
<i
class="fa fa-caret-square-right"
style="font-size: 1.7em; color: #cccccc" *ngIf="columnSets[i].additionalData.pinned === 'right'"
></i>
<i
class="fa fa-square"
style="font-size: 1.7em; color: #cccccc" *ngIf="!columnSets[i].additionalData.pinned"
></i>
</ion-button>
</ion-row> </ion-row>
<ion-row> <ion-row>
<ion-button fill="outline" color="light" size="small" (click)="onUpArrow(i)"> <ion-button fill="outline" color="light" size="small" (click)="onUpArrow(i)">

View File

@ -84,4 +84,13 @@ export class ColumnsComponent implements OnInit {
} }
} }
iteratePin(i) {
if ( !this.columnSets[i].additionalData.pinned ) {
this.columnSets[i].additionalData.pinned = 'left';
} else if ( this.columnSets[i].additionalData.pinned === 'left' ) {
this.columnSets[i].additionalData.pinned = 'right';
} else {
delete this.columnSets[i].additionalData.pinned;
}
}
} }

View File

@ -225,6 +225,10 @@ export class DatabaseComponent extends EditorNodeContract implements OnInit {
x.width = x.additionalData.width; x.width = x.additionalData.width;
} }
if ( x.additionalData?.pinned ) {
x.pinned = x.additionalData.pinned;
}
// Set editors and renderers for different types // Set editors and renderers for different types
if ( x.Type === 'text' ) { if ( x.Type === 'text' ) {
x.editor = 'agTextCellEditor'; x.editor = 'agTextCellEditor';