src/ui/grid-view-manager/smart-grid-view-manager.component.ts
OnInit
AfterViewInit
OnDestroy
| changeDetection | ChangeDetectionStrategy.Eager |
| providers |
SmartGridViewManagerService
SmartGridViewSerializationService
|
| selector | smart-grid-view-manager |
| styleUrls | ./smart-grid-view-manager.component.scss |
| templateUrl | ./smart-grid-view-manager.component.html |
Properties |
|
Methods |
|
Inputs |
constructor(injector: Injector, viewManagerRegistry: SmartGridViewManagerRegistryService)
|
|||||||||
|
Parameters :
|
| context |
Type : string
|
| gridInstanceName |
Type : string
|
| ignoreFlexboxLayout |
Type : boolean
|
| smart-help-text |
Type : string | undefined
|
|
Sets the HelpText value for this form child. |
| smart-instance-name |
Type : string
|
|
The instance name of the component |
| smart-object-name |
Type : string
|
|
The object name of the component |
| Public handleLayoutChange | ||||||||
handleLayoutChange(_newLayout: any)
|
||||||||
|
Called when the form layout changes.
Parameters :
Returns :
void
|
| Public Async loadViews |
loadViews()
|
|
Loads stored views from the backend.
Returns :
Promise<boolean>
True when stored views were loaded. |
| Public Async restoreInitialViewForAutoFetch |
restoreInitialViewForAutoFetch()
|
|
Restores the initial view while a linked datasource is coordinating startup.
Returns :
Promise<StartupAction>
|
| Public notifyLoadingFinished | ||||||
notifyLoadingFinished(objectName: string)
|
||||||
|
Notifies the parent Smart Form that this form child has finished loading
Parameters :
Returns :
void
void |
| Public injector |
Type : Injector
|
<!--
**************************************************************************
* Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") - *
* www.consultingwerk.com and other contributors as listed *
* below. All Rights Reserved. *
* *
* Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY *
* KIND, either express or implied. *
* *
* Contributors: *
* *
**************************************************************************
--------------------------------------------------------------------------
File : smart-grid-view-manager.component.html
Purpose : Template for the Smart Grid View Manager component.
Author(s) : Oana Sucigan
Created : Apr 29, 2026
--------------------------------------------------------------------------
-->
<div class="smart-grid-view-manager">
<div class="smart-grid-view-manager-view-field">
<label class="smart-grid-view-manager-label k-form-label">View:</label>
<kendo-dropdownlist
class="smart-grid-view-manager-dropdown"
[data]="views()"
[value]="selectedView()"
[textField]="'viewName'"
[valueField]="'userProfileGuid'"
[valuePrimitive]="false"
[loading]="isLoading()"
[disabled]="isLoading()"
(valueChange)="onViewSelected($event)"
>
<ng-template kendoDropDownListValueTemplate let-dataItem>
<span class="smart-grid-view-manager-view-label">
@if (getViewIconClass(dataItem); as iconClass) {
<i
class="smart-grid-view-manager-view-icon"
[ngClass]="iconClass"
></i>
} @else if (getViewImageUrl(dataItem); as imageUrl) {
<img
class="smart-grid-view-manager-view-image"
[src]="imageUrl"
[alt]="dataItem?.viewName || ''"
>
}
<span>{{ dataItem?.viewName }}</span>
@if (isSelectedViewDirty() && !dataItem?.isDefault) {
<span
class="smart-grid-view-manager-dirty-icon"
title="View has unsaved changes"
>*</span>
}
</span>
</ng-template>
<ng-template kendoDropDownListItemTemplate let-dataItem>
<span class="smart-grid-view-manager-view-label">
@if (getViewIconClass(dataItem); as iconClass) {
<i
class="smart-grid-view-manager-view-icon"
[ngClass]="iconClass"
></i>
} @else if (getViewImageUrl(dataItem); as imageUrl) {
<img
class="smart-grid-view-manager-view-image"
[src]="imageUrl"
[alt]="dataItem?.viewName || ''"
>
}
<span>{{ dataItem?.viewName }}</span>
</span>
</ng-template>
</kendo-dropdownlist>
</div>
<kendo-buttongroup class="smart-grid-view-manager-actions">
<button
kendoButton
iconClass="fa-solid fa-floppy-disk"
title="Save"
[disabled]="isLoading() || isDefaultViewSelected() || !isSelectedViewDirty()"
(click)="onSave()"
>Save</button>
<button
kendoButton
iconClass="fa-solid fa-plus"
title="Save As"
[disabled]="isLoading()"
(click)="onSaveAs()"
>Save As</button>
<button
kendoButton
iconClass="fa-solid fa-trash"
title="Delete"
[disabled]="isLoading() || isDefaultViewSelected()"
(click)="onDelete()"
>Delete</button>
</kendo-buttongroup>
</div>
./smart-grid-view-manager.component.scss
/**************************************************************************
* Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") - *
* www.consultingwerk.com and other contributors as listed *
* below. All Rights Reserved. *
* *
* Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY *
* KIND, either express or implied. *
* *
* Contributors: *
* *
**************************************************************************/
/*-------------------------------------------------------------------------
File : smart-grid-view-manager.component.scss
Purpose : Styles for the Smart Grid View Manager component
Author(s) : Oana Sucigan
Created : Apr 29, 2026
--------------------------------------------------------------------------*/
:host {
container-name: smart-grid-view-manager;
container-type: inline-size;
display: block;
min-width: 0;
width: 100%;
}
.smart-grid-view-manager {
align-items: center;
display: flex;
flex-wrap: nowrap;
gap: var(--kendo-spacing-2, 0.5rem);
width: 100%;
&-view-field {
align-items: center;
display: flex;
flex: 1 1 auto;
gap: var(--kendo-spacing-2, 0.5rem);
min-width: 0;
}
&-label {
flex: 0 0 auto;
margin-bottom: 0;
white-space: nowrap;
}
&-dropdown {
flex: 1 1 auto;
min-width: 180px;
}
&-actions {
flex: 0 0 auto;
}
&-view-label {
align-items: center;
display: inline-flex;
gap: 0.4rem;
min-width: 0;
}
&-view-image {
flex: 0 0 auto;
height: 16px;
object-fit: contain;
width: 16px;
}
&-view-icon {
flex: 0 0 auto;
text-align: center;
width: 16px;
}
&-dirty-icon {
flex: 0 0 auto;
line-height: 1;
}
}
// Medium: label beside dropdown; buttons on their own row
@container smart-grid-view-manager (max-width: 32rem) {
.smart-grid-view-manager {
align-items: stretch;
flex-direction: column;
&-view-field {
width: 100%;
}
&-dropdown {
min-width: 0;
::ng-deep .k-picker {
width: 100%;
}
::ng-deep .k-input-button {
flex-shrink: 0;
}
::ng-deep .k-input-inner {
min-width: 0;
overflow: hidden;
}
::ng-deep .k-input-value-text {
overflow: hidden;
text-overflow: ellipsis;
}
}
&-actions {
align-self: flex-end;
}
}
}
// Narrow: label, dropdown, and buttons each on their own row
@container smart-grid-view-manager (max-width: 20rem) {
.smart-grid-view-manager {
&-view-field {
align-items: stretch;
flex-direction: column;
}
}
}