src/lib/components/data-control-field/data-control-field.component.ts
Angular Component for the DataControlField Control.
ControlComponent
changeDetection | ChangeDetectionStrategy.OnPush |
Properties |
|
Methods |
Inputs |
Accessors |
constructor(refCh: ChangeDetectorRef, renderer2: Renderer2, element: ElementRef, webComponents: WebComponentsService, bringTopServ: BringTopService)
|
||||||||||||||||||
Creates an instance of DataControlFieldComponent.
Parameters :
|
headerText | |
Type : string
|
|
Gets/sets the headerText property. |
sortExpression | |
Type : string
|
|
Gets/sets the sortExpression property. |
visible | |
Type : boolean
|
|
Gets/sets the visible property. |
isBindedEvent | ||||||
isBindedEvent(event: string)
|
||||||
Override the isBindedEvent to get the event from the Field model
Parameters :
Returns :
boolean
{boolean} |
Private headerTextInternal |
Type : string
|
Default value : ''
|
Property to save the headerText value. |
Private sortExpressionInternal |
Type : string
|
Default value : ''
|
Property to save the sortExpression value. |
Private visibleInternal |
Default value : true
|
Property to save the visible value. |
headerText | ||||||
getheaderText()
|
||||||
setheaderText(value: string)
|
||||||
Gets/sets the headerText property.
Parameters :
Returns :
void
|
sortExpression | ||||||
getsortExpression()
|
||||||
setsortExpression(value: string)
|
||||||
Gets/sets the sortExpression property.
Parameters :
Returns :
void
|
headerStyle |
getheaderStyle()
|
Gets the headerStyle property.
Returns :
any
|
itemStyle |
getitemStyle()
|
Gets the itemStyle property.
Returns :
any
|
visible | ||||||
getvisible()
|
||||||
setvisible(value: boolean)
|
||||||
Gets/sets the visible property.
Parameters :
Returns :
void
|
id |
getid()
|
Gets the id from the model of the data control field
Returns :
any
|
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ElementRef,
Input,
Optional,
Renderer2
} from '@angular/core';
import { BringTopService } from '@mobilize/base-components';
import {
ControlComponent,
WebComponentsService
} from '@mobilize/winforms-components';
/**
* Angular Component for the DataControlField Control.
*
* @export
* @class DataControlFieldComponent
* @extends {ControlComponent}
*/
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
template: ''
})
export class DataControlFieldComponent extends ControlComponent {
/**
* Property to save the headerText value.
*
* @private
* @memberof DataControlFieldComponent
*/
private headerTextInternal = '';
/**
* Property to save the sortExpression value.
*
* @private
* @memberof DataControlFieldComponent
*/
private sortExpressionInternal = '';
/**
* Property to save the visible value.
*
* @private
* @memberof DataControlFieldComponent
*/
private visibleInternal = true;
/**
* Creates an instance of DataControlFieldComponent.
*
* @param {ChangeDetectorRef} refCh
* @param {Renderer2} renderer2
* @param {ElementRef} element
* @param {WebComponentsService} webComponents
* @param {BringTopService} bringTopServ
* @memberof DataControlFieldComponent
*/
constructor(
private refCh: ChangeDetectorRef,
private renderer2: Renderer2,
private element: ElementRef,
webComponents: WebComponentsService,
@Optional() private bringTopServ: BringTopService
) {
super(refCh, renderer2, element, webComponents, bringTopServ);
}
/**
* Gets/sets the headerText property.
*
* @memberof DataControlFieldComponent
*/
@Input()
set headerText(value: string) {
this.headerTextInternal = value;
}
get headerText(): string {
return this.model?.HeaderText ?? this.headerTextInternal;
}
/**
* Gets/sets the sortExpression property.
*
* @memberof DataControlFieldComponent
*/
@Input()
set sortExpression(value: string) {
this.sortExpressionInternal = value;
}
get sortExpression(): string {
return this.model?.SortExpression ?? this.sortExpressionInternal;
}
/**
* Gets the headerStyle property.
*
* @readonly
* @type {*}
* @memberof DataControlFieldComponent
*/
get headerStyle(): any {
return this.model?.HeaderStyle;
}
/**
* Gets the itemStyle property.
*
* @readonly
* @type {*}
* @memberof DataControlFieldComponent
*/
get itemStyle(): any {
return this.model?.ItemStyle;
}
/**
* Gets/sets the visible property.
*
* @memberof DataControlFieldComponent
*/
@Input()
set visible(value: boolean) {
this.visibleInternal = value;
}
get visible(): boolean {
return this.model?.Visible ?? this.visibleInternal;
}
/**
* Gets the id from the model of the data control field
*
* @readonly
* @type {*}
* @memberof DataControlFieldComponent
*/
get id(): any {
return this.model?.Id;
}
/**
* Override the isBindedEvent to get the event from the Field model
*
* @param {string} event
* @return {*} {boolean}
* @memberof DataControlFieldComponent
*/
isBindedEvent(event: string): boolean {
return (
this.model?.EventChanges != null && this.model.EventChanges[event] != null
);
}
}