datapoint-selector/datapoint-selector-modal/datapoint-selector-modal.component.ts
OnInit
selector | c8y-datapoint-selector-modal |
templateUrl | ./datapoint-selector-modal.component.html |
Properties |
Methods |
constructor(bsModal: BsModalRef, elementRef: ElementRef)
|
|||||||||
Parameters :
|
close |
close()
|
Returns :
void
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
saveChanges |
saveChanges()
|
Returns :
void
|
selectionChange | ||||||
selectionChange(selection: Array<KPIDetails>)
|
||||||
Parameters :
Returns :
void
|
allowChangingContext |
Default value : true
|
allowDatapointsFromMultipleAssets |
Default value : true
|
allowSearch |
Default value : true
|
assetSelectorConfig |
Type : Partial<DatapointSelectorModalAssetSelectorOptions>
|
Default value : {}
|
contextAsset |
Type : IIdentified
|
defaultActiveState |
Default value : true
|
finishWithFirstSelection |
Default value : false
|
guessDatapointUnit |
Default value : true
|
ignoreDatapointTemplates |
Default value : false
|
Readonly result |
Type : Promise<KPIDetails[]>
|
Default value : new Promise((resolve, reject) => {
this.save = resolve;
this.cancel = reject;
})
|
saveButtonLabel |
Type : string
|
Default value : gettext('Add data points')
|
selectedDatapoints |
Default value : new Array<KPIDetails>()
|
title |
Type : string
|
Default value : gettext('Data point selector')
|
<div class="modal-header separator">
<h4 id="modal-title" class="text-medium">{{ title | translate }}</h4>
</div>
<div class="modal-inner-scroll modal-inner-scroll--fixed" id="modal-body">
<c8y-datapoint-selector
[contextAsset]="contextAsset"
[guessDatapointUnit]="guessDatapointUnit"
[allowDatapointsFromMultipleAssets]="allowDatapointsFromMultipleAssets"
[allowChangingContext]="allowChangingContext"
[defaultActiveState]="defaultActiveState"
[allowSearch]="allowSearch"
[hideSelection]="finishWithFirstSelection"
[ignoreDatapointTemplates]="ignoreDatapointTemplates"
[ngModel]="selectedDatapoints"
(ngModelChange)="selectionChange($event)"
></c8y-datapoint-selector>
</div>
<div class="modal-footer">
<button
type="button"
[title]="'Cancel' | translate"
class="btn btn-default"
(click)="close()"
translate
>
Cancel
</button>
<button
[title]="saveButtonLabel | translate"
class="btn btn-primary"
[disabled]="!this.selectedDatapoints?.length"
(click)="saveChanges()"
*ngIf="!finishWithFirstSelection"
>
{{ saveButtonLabel | translate }}
</button>
</div>