Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ViewBase

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Private _automaticallyAdjustsScrollViewInsets

_automaticallyAdjustsScrollViewInsets: boolean

_context

_context: any

_cssState

_cssState: any

Private _defaultPaddingBottom

_defaultPaddingBottom: number

Private _defaultPaddingLeft

_defaultPaddingLeft: number

Private _defaultPaddingRight

_defaultPaddingRight: number

Private _defaultPaddingTop

_defaultPaddingTop: number

_domId

_domId: number

_isAddedToNativeVisualTree

_isAddedToNativeVisualTree: boolean

Private _isPaddingRelative

_isPaddingRelative: boolean

Private _isStyleScopeHost

_isStyleScopeHost: boolean

Private _isViewBase

_isViewBase: boolean

Filed to use instead of instanceof ViewBase.

Private _oldBottom

_oldBottom: number

Private _oldLeft

_oldLeft: number

Private _oldRight

_oldRight: number

Private _oldTop

_oldTop: number

_styleScope

_styleScope: any

_suspendNativeUpdatesCount

_suspendNativeUpdatesCount: number

Determines the depth of suspended updates. When the value is 0 the current property updates are not batched nor scoped and must be immediately applied. If the value is 1 or greater, the current updates are batched and does not have to provide immediate update. Do not set this field, the _batchUpdate method is responsible to keep the count up to date, as well as adding/rmoving the view to/from the visual tree.

Private _suspendedUpdates

_suspendedUpdates: object

A property bag holding suspended native updates. Native setters that had to execute while there was no native view, or the view was detached from the visual tree etc. will accumulate in this object, and will be applied when all prerequisites are met.

Type declaration

alignSelf

alignSelf: AlignSelf

android

android: any

bindingContext

bindingContext: any

className

className: string

Gets or sets the CSS class name for this view.

col

col: number

colSpan

colSpan: number

cssClasses

cssClasses: Set<string>

cssPseudoClasses

cssPseudoClasses: Set<string>

dock

dock: "left" | "top" | "right" | "bottom"

domNode

domNode: DOMNode

effectiveBorderBottomWidth

effectiveBorderBottomWidth: number

effectiveBorderLeftWidth

effectiveBorderLeftWidth: number

effectiveBorderRightWidth

effectiveBorderRightWidth: number

effectiveBorderTopWidth

effectiveBorderTopWidth: number

effectiveHeight

effectiveHeight: number

effectiveLeft

effectiveLeft: number

effectiveMarginBottom

effectiveMarginBottom: number

effectiveMarginLeft

effectiveMarginLeft: number

effectiveMarginRight

effectiveMarginRight: number

effectiveMarginTop

effectiveMarginTop: number

effectiveMinHeight

effectiveMinHeight: number

effectiveMinWidth

effectiveMinWidth: number

effectivePaddingBottom

effectivePaddingBottom: number

effectivePaddingLeft

effectivePaddingLeft: number

effectivePaddingRight

effectivePaddingRight: number

effectivePaddingTop

effectivePaddingTop: number

effectiveTop

effectiveTop: number

effectiveWidth

effectiveWidth: number

flexGrow

flexGrow: FlexGrow

flexShrink

flexShrink: FlexShrink

flexWrapBefore

flexWrapBefore: FlexWrapBefore

id

id: string

Gets or sets the id for this view.

ios

ios: any

isCollapsed

isCollapsed: boolean

Returns true if visibility is set to 'collapse'. Readonly property

isLoaded

isLoaded: boolean

left

left: Length

nativeView

nativeView: any

nativeViewProtected

nativeViewProtected: any

read-only. If you want to set out-of-band the nativeView use the setNativeView method.

order

order: Order

page

page: Page

Gets owner page. This is a read-only property.

parent

parent: ViewBase

Gets the parent view. This property is read-only.

parentNode

parentNode: ViewBase

Gets the template parent or the native parent. Sets the template parent.

Private recycleNativeView

recycleNativeView: "always" | "never" | "auto"

row

row: number

rowSpan

rowSpan: number

style

style: Style

Gets the style object associated to this view.

top

top: Length

typeName

typeName: string

Gets the name of the constructor function for this instance. E.g. for a Button class this will return "Button".

viewController

viewController: any

returns the native UIViewController.

Static loadedEvent

loadedEvent: string

String value used when hooking to loaded event.

Static propertyChangeEvent

propertyChangeEvent: string

String value used when hooking to propertyChange event.

Static unloadedEvent

unloadedEvent: string

String value used when hooking to unloaded event.

Methods

_addView

  • _addView(view: ViewBase, atIndex?: number): void

_addViewCore

  • _addViewCore(view: ViewBase, atIndex?: number): void

_addViewToNativeVisualTree

  • _addViewToNativeVisualTree(view: ViewBase, atIndex?: number): boolean
  • Performs the core logic of adding a child view to the native visual tree. Returns true if the view's native representation has been successfully added, false otherwise.

    Parameters

    • view: ViewBase
    • Optional atIndex: number

    Returns boolean

_applyXmlAttribute

  • _applyXmlAttribute(attribute: any, value: any): boolean
  • This used to be the way to set attribute values in early {N} versions. Now attributes are expected to be set as plain properties on the view instances.

    deprecated

    Parameters

    • attribute: any
    • value: any

    Returns boolean

_batchUpdate

  • _batchUpdate<T>(callback: function): T
  • Allow multiple updates to be performed on the instance at once.

    Type parameters

    • T

    Parameters

    • callback: function
        • (): T
        • Returns T

    Returns T

_childIndexToNativeChildIndex

  • _childIndexToNativeChildIndex(index?: number): number

Private _createPropertyChangeData

_dialogClosed

  • _dialogClosed(): void

Private _emit

  • _emit(eventNames: string): any

_goToVisualState

  • _goToVisualState(state: string): void

Private _inheritStyleScope

  • _inheritStyleScope(styleScope: any): void

Private _onCssStateChange

  • _onCssStateChange(): void

_onRootViewReset

  • _onRootViewReset(): void

_parentChanged

  • _parentChanged(oldParent: ViewBase): void

_removeView

_removeViewCore

_removeViewFromNativeVisualTree

  • _removeViewFromNativeVisualTree(view: ViewBase): void

Private _setupAsRootView

  • _setupAsRootView(context: any): void

_setupUI

  • _setupUI(context: any, atIndex?: number): void
  • Setups the UI for ViewBase and all its children recursively. This method should not be overridden by derived views.

    Parameters

    • context: any
    • Optional atIndex: number

    Returns void

_tearDownUI

  • _tearDownUI(force?: boolean): void
  • Tears down the UI for ViewBase and all its children recursively. This method should not be overridden by derived views.

    Parameters

    • Optional force: boolean

    Returns void

addEventListener

  • addEventListener(eventNames: string, callback: function, thisArg?: any): any
  • Adds a listener for the specified event name.

    Parameters

    • eventNames: string

      Comma delimited names of the events to attach the listener to.

    • callback: function

      A function to be called when some of the specified event(s) is raised.

    • Optional thisArg: any

      An optional parameter which when set will be used as "this" in callback method call.

    Returns any

Protected addPseudoClass

  • addPseudoClass(name: string): void

bind

Private callLoaded

  • callLoaded(): void

Private callUnloaded

  • callUnloaded(): void

closeModal

  • closeModal(context?: any): void
  • Closes the current modal view that this page is showing.

    Parameters

    • Optional context: any

      Any context you want to pass back to the host when closing the modal view.

    Returns void

createNativeView

  • createNativeView(): Object

Protected deletePseudoClass

  • deletePseudoClass(name: string): void

disposeNativeView

  • disposeNativeView(): void

eachChild

  • eachChild(callback: function): void
  • Iterates over children of type ViewBase.

    Parameters

    • callback: function

      Called for each child of type ViewBase. Iteration stops if this method returns falsy value.

    Returns void

ensureDomNode

  • ensureDomNode(): any

get

  • get(name: string): any

getViewById

  • getViewById<T>(id: string): T

hasListeners

  • hasListeners(eventName: string): boolean

initNativeView

  • initNativeView(): void

loadView

notify

  • notify<T>(data: T): void

notifyPropertyChange

  • notifyPropertyChange(propertyName: string, value: any, oldValue?: any): void

off

  • off(eventNames: string, callback?: any, thisArg?: any): any

on

  • on(eventNames: string, callback: function, thisArg?: any): any
  • on(event: "propertyChange", callback: function, thisArg?: any): any
  • A basic method signature to hook an event listener (shortcut alias to the addEventListener method).

    Parameters

    • eventNames: string

      String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by , (e.g. "propertyChange", "change").

    • callback: function

      Callback function which will be executed when event is raised.

    • Optional thisArg: any

      An optional parameter which will be used as this context for callback execution.

    Returns any

  • Raised when a propertyChange occurs.

    Parameters

    • event: "propertyChange"
    • callback: function
    • Optional thisArg: any

    Returns any

onLoaded

  • onLoaded(): void

onResumeNativeUpdates

  • onResumeNativeUpdates(): void

onUnloaded

  • onUnloaded(): void

once

  • once(event: string, callback: function, thisArg?: any): any
  • Adds one-time listener function for the event named event.

    Parameters

    • event: string

      Name of the event to attach to.

    • callback: function

      A function to be called when the specified event is raised.

    • Optional thisArg: any

      An optional parameter which when set will be used as "this" in callback method call.

    Returns any

removeEventListener

  • removeEventListener(eventNames: string, callback?: any, thisArg?: any): any
  • Removes listener(s) for the specified event name.

    Parameters

    • eventNames: string

      Comma delimited names of the events the specified listener is associated with.

    • Optional callback: any

      An optional parameter pointing to a specific listener. If not defined, all listeners for the event names will be removed.

    • Optional thisArg: any

      An optional parameter which when set will be used to refine search of the correct callback which will be removed as event listener.

    Returns any

requestLayout

  • requestLayout(): void

resetNativeView

  • resetNativeView(): void

set

  • set(name: string, value: any): void

setInlineStyle

  • setInlineStyle(style: string): void

setNativeView

  • setNativeView(view: any): void
  • Set the nativeView field performing extra checks and updates to the native properties on the new view. Use in cases where the createNativeView is not suitable. As an example use in item controls where the native parent view will create the native views for child items.

    Parameters

    • view: any

    Returns void

showModal

  • showModal(moduleName: string, context: any, closeCallback: Function, fullscreen?: boolean, animated?: boolean, stretched?: boolean): ViewBase
  • showModal(view: ViewBase, context: any, closeCallback: Function, fullscreen?: boolean, animated?: boolean, stretched?: boolean): ViewBase
  • showModal(): ViewBase
  • Shows the View contained in moduleName as a modal view.

    Parameters

    • moduleName: string

      The name of the module to load starting from the application root.

    • context: any

      Any context you want to pass to the modally shown view. This same context will be available in the arguments of the shownModally event handler.

    • closeCallback: Function

      A function that will be called when the view is closed. Any arguments provided when calling ShownModallyData.closeCallback will be available here.

    • Optional fullscreen: boolean

      An optional parameter specifying whether to show the modal view in full-screen mode.

    • Optional animated: boolean

      An optional parameter specifying whether to show the modal view with animation.

    • Optional stretched: boolean

      An optional parameter specifying whether to stretch the modal view when not in full-screen mode.

    Returns ViewBase

  • Shows the view passed as parameter as a modal view.

    Parameters

    • view: ViewBase

      View instance to be shown modally.

    • context: any

      Any context you want to pass to the modally shown view. This same context will be available in the arguments of the shownModally event handler.

    • closeCallback: Function

      A function that will be called when the view is closed. Any arguments provided when calling ShownModallyData.closeCallback will be available here.

    • Optional fullscreen: boolean

      An optional parameter specifying whether to show the modal view in full-screen mode.

    • Optional animated: boolean

      An optional parameter specifying whether to show the modal view with animation.

    • Optional stretched: boolean

      An optional parameter specifying whether to stretch the modal view when not in full-screen mode.

    Returns ViewBase

  • Deprecated. Showing view as modal is deprecated. Use showModal method with arguments.

    Returns ViewBase

unbind

  • unbind(property: string): void

unloadView

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method