src/ui/viewer/smart-viewer.component.ts
AbstractFormChild
OnInit
AfterViewInit
OnDestroy
providers |
SmartHttpService
|
selector | smart-viewer |
styleUrls | ./smart-viewer.component.css |
templateUrl | ./smart-viewer.component.html |
viewProviders |
|
Properties |
Methods |
Inputs |
Outputs |
Accessors |
constructor(dsRegistry: DataSourceRegistry, toolbarRegistry: SmartToolbarRegistry, smartHttp: SmartHttpService, smartServiceAdapter: SmartServiceAdapter, navigationService: SmartNavigationService, elementRef: ElementRef, viewerRegistry: SmartViewerRegistryService, errorHandler: SmartErrorHandlerService, widgetFactory: WidgetFacadeFactory, helperService: SmartViewerHelperService, smartConfig: SmartConfig, injector: Injector, renderer: Renderer2, smartFormInstanceService?: SmartFormInstanceService)
|
|||||||||||||||||||||||||||||||||||||||||||||
Parameters :
|
focusOnAdd |
Type : string
|
If set, the Smart Viewer will focus this field when it's attached data source adds a record. |
focusOnCopy |
Type : string
|
If set, the Smart Viewer will focus this field when a record is copied. |
smart-data-source |
Type : string
|
The name of the SmartDataSource that the Smart Viewer should attach itself to. |
smart-object-name |
Type : string
|
smart-tableio-source |
Type : string
|
If set, the Smart Viewer will attempt to find the SmartToolbarComponent registered under this name and listen to button clicked events. |
smart-viewer-layout |
Type : any
|
The layout (template) that the Smart Viewer should fetch and render. |
smart-viewer-settings |
Type : literal type
|
smart-viewer-template |
Type : string
|
The template that the Smart Viewer should render. Note: not to be confused with the smartViewerTemplate. This represents an actual HTML template that should be renderd directly. |
inputBlurred |
Type : EventEmitter<string>
|
inputFocused |
Type : EventEmitter<string>
|
inputValueChanged |
Type : EventEmitter<InputChangedEventArgs>
|
Fires when an input belonging to the Smart Viewer changes it's value. |
selectedChange |
Type : EventEmitter<any>
|
viewerButtonClicked |
Type : EventEmitter<SmartViewerFieldSettings>
|
checkViewerForUnboundFields | ||||||
checkViewerForUnboundFields(viewerLayout: any)
|
||||||
Parameters :
Returns :
void
|
checkViewersPadding |
checkViewersPadding()
|
Returns :
void
|
componentLoaded |
componentLoaded()
|
Used internally. Sets up key listeners on child input elements that trigger the UPDATING state on the attached datasource when values are changed.
Returns :
void
|
focusField | ||||||||
focusField(fieldToFocus: string)
|
||||||||
Moves focus to the specified viewer field input
Parameters :
Returns :
void
|
Public handleLayoutChange | ||||||
handleLayoutChange(newLayout: literal type)
|
||||||
Parameters :
Returns :
void
|
trackBy | ||||||
trackBy(index: number)
|
||||||
Parameters :
Returns :
number
|
createDisabled |
Type : boolean
|
deleteDisabled |
Type : boolean
|
domElement |
Type : ElementRef
|
Decorators :
@ViewChild('fakeComponent')
|
enabledStateMonitored |
Type : QueryList<EnabledStateDirective>
|
Decorators :
@ContentChildren(EnabledStateDirective)
|
fieldHeightsAdded |
Type : boolean
|
fields |
Type : SmartViewerFormItem[]
|
fieldsetHeightsAdded |
Type : boolean
|
hasAbsolutePosition |
Default value : false
|
maxDepthValue |
Type : number
|
Default value : 0
|
readDisabled |
Type : boolean
|
readOnly |
Type : boolean
|
self |
Type : any
|
Default value : this
|
smartDs |
Type : SmartDataSource
|
Default value : {} as SmartDataSource
|
The SmartDataSource instance that this viewer is attached to. |
smartLookups |
Type : QueryList<SmartLookupComponent>
|
Decorators :
@ContentChildren(SmartLookupComponent)
|
updateDisabled |
Type : boolean
|
viewerFormPadding |
Type : number
|
Default value : 0
|
viewerLayout |
Type : any
|
viewerTemplate |
Type : SmartViewerTemplateDirective
|
Decorators :
@ContentChild(SmartViewerTemplateDirective)
|
settings | ||||||
getsettings()
|
||||||
Returns :
literal type
|
||||||
setsettings(value: literal type)
|
||||||
Parameters :
Returns :
void
|
state | ||||
getstate()
|
||||
The current state of the Smart Viewer
Returns :
VIEWER_STATE
|
||||
setstate(value)
|
||||
Parameters :
Returns :
void
|
viewerFormDomElement | ||||
getviewerFormDomElement()
|
||||
Returns :
ElementRef
|
||||
setviewerFormDomElement(viewerForm)
|
||||
Parameters :
Returns :
void
|
viewerContainerDomElement | ||||
getviewerContainerDomElement()
|
||||
Returns :
ElementRef
|
||||
setviewerContainerDomElement(container)
|
||||
Parameters :
Returns :
void
|
fieldChildren | ||||
setfieldChildren(fieldChildren)
|
||||
Parameters :
Returns :
void
|
fieldsetChildren | ||||
setfieldsetChildren(fieldsetChildren)
|
||||
Parameters :
Returns :
void
|
smartViewerTemplate | ||||||
setsmartViewerTemplate(value: any)
|
||||||
The layout (template) that the Smart Viewer should fetch and render.
Parameters :
Returns :
void
|
template | ||||||
gettemplate()
|
||||||
Returns :
string
|
||||||
settemplate(value: string)
|
||||||
The template that the Smart Viewer should render. Note: not to be confused with the smartViewerTemplate. This represents an actual HTML template that should be renderd directly.
Parameters :
Returns :
void
|
viewerState |
getviewerState()
|
Returns :
StateEvents
|
selected | ||||||
getselected()
|
||||||
The viewer's attached datasource's selected record.
Returns :
any
|
||||||
setselected(value: any)
|
||||||
Parameters :
Returns :
void
|
<div
#container id="form-container"
[ngClass]="settings?.classList">
<form #viewerForm [ngClass]="(settings?.classList.indexOf('labels-left') > -1 || hasAbsolutePosition) ? 'k-form-inline' : 'k-form'">
<ng-container *ngFor="let formItem of fields let i=index trackBy: trackBy">
<smart-viewer-fieldset
*ngIf="formItem.type === 'fieldset'"
[hasAbsolutePosition]="hasAbsolutePosition"
[definition]="formItem"
[itemIndex]="i"
[inline-labels]="settings?.classList.indexOf('labels-left') > -1 || hasAbsolutePosition">
</smart-viewer-fieldset>
<smart-viewer-group
*ngIf="formItem.type === 'group'"
[hasAbsolutePosition]="hasAbsolutePosition"
[definition]="formItem">
</smart-viewer-group>
<smart-viewer-field
[ngClass]="{ first: i === 0 }"
*ngIf="formItem.type !== 'fieldset' && formItem.type !== 'group'"
[hasAbsolutePosition]="hasAbsolutePosition"
[field]="formItem"
[inline-label]="settings?.classList.indexOf('labels-left') > -1 || hasAbsolutePosition">
</smart-viewer-field>
</ng-container>
<div class="row" *ngIf="readDisabled">
<p class="col-12">* Read access is restricted.</p>
</div>
</form>
</div>
./smart-viewer.component.css
::ng-deep kendo-numerictextbox .k-numeric-wrap input.k-input {
text-align: right !important;
height: 100% !important
}
::ng-deep input[disabled],
textarea[disabled],
select[disabled],
[smart-widget-disabled] {
background-color: #eee !important;
}
::ng-deep input, ::ng-deep label {
font-weight: normal !important;
}
::ng-deep form.k-form {
padding-left: 0px !important;
padding-right: 0px !important;
position: relative !important;
}
#form-container {
overflow-y: auto !important;
}
::ng-deep .absolute-layout .k-form-field.smart-checkbox label,
::ng-deep .absolute-layout .k-form-field span {
white-space: nowrap !important;
}
::ng-deep .absolute-layout .smart-viewer-fieldset {
margin-top: 0px !important;
}