ViewNavigator

ViewNavigator

UI navigation manages by ViewNavigator.

ViewNavigator is base class which have simple view navigation functionality.

It manages set of view using stack-based history mechanism which also called as ViewStack.

Each Viewstack represent its own view history stack.Having multiple Viewstacks ViewNavigator can manage multiple history stacks.

ViewNavigator also Manages LifeCycle of View.

ViewNavigator HTML DOM wrapper: < div class="vjs-viewnavigator ${navigatorId}" >

ViewNavigator LifeCycle methods executes in given order :

  1. Creation : constructor, initNavigator, render

  2. Destruction : destroy

Following methods overrides and implement by ViewNavigator subclass executes in given order :

  1. Creation : constructor, initNavigator, renderNavigatorContent, createView, createViewStack, initEventRoutes

  2. Destruction : destroy

Constructor

new ViewNavigator(_id, _parentId, _parentContainerId)

Source:

UI navigation manages by ViewNavigator.

ViewNavigator" is base class which have simple view navigation functionality.

ViewNavigator manages set of view using stack-based history mechanism which also called as ViewStack.

Each Viewstack represent its own view history stack. So vyanjs supports multiple history stack too.

ViewNavigator also Manages LifeCycle of View.

Parameters:
Name Type Default Description
_id String

ViewNavigator ID

_parentId String null

Parent ID View or "root" DOM Element

_parentContainerId String null

Parent Container ID

Classes

ViewNavigator

Members

eventRouter

Source:

Set EventRouter for ViewNavigator, EventRouter is useful for EventBased Navigation and for navigation of single view or multiple views.

(readonly) eventRouter

Source:

Returns EventRouter instance of ViewNavigator

history

Source:

Sets Navigation History Boolean Property , returns True if Component is Enabled

Methods

createView(_viewId, _route, _navparams, _viewStackId) → {Object}

Source:

By Default View class will be created When Overrides by Subclass , custom Views will be created

Parameters:
Name Type Description
_viewId String

View ID

_route String

Navigation Route / Path

_navparams String

Navigation Parameters pass to View

_viewStackId String

Parent Viewstack ID of View

Returns:
  • View Instance
Type
Object

createViewStack(_viewStackId, _route, _parentId) → {Object}

Source:

By Default ViewStack class will be created When Overrides by Subclass , custom Viewstack will be created

Parameters:
Name Type Description
_viewStackId String

ViewStack ID

_route String

Navigation Route / Path

_parentId String

Parent ViewNavigator ID

Returns:
  • ViewStack Instance
Type
Object

destroy()

Source:

ViewNavigator Lifecycle Method,

Call by ViewManager to destroy ViewNavigator,

Remove Event Handlers, Make Properties null,

Remove Views and Viewstack objects.

Remove ViewNavigator DOM Element and Its Contents

Remove EventRoute Object

getView(_viewId) → {Object}

Source:

Get ViewObject by ViewId

Parameters:
Name Type Description
_viewId string

ViewID

Returns:
  • View Instance
Type
Object

getViewStack(_viewStackId) → {Object}

Source:

Get ViewStack Object by ViewStackId

Parameters:
Name Type Description
_viewStackId String

ViewStackID

Returns:
  • ViewStack Instance
Type
Object

initNavigator()

Source:

Implemented by Subclass Call by ViewNavigator Constructor

Source:

Call by ViewManager Navigation Route and Navigation EventRoute Combination must be unique

Parameters:
Name Type Description
_route String

Navigation Route

_navevent String

Navigation Event Route

_navparams String

Parameters pass to View

Source:

Call by ViewManager or ViewNavigator internally Navigate back to previous View if history set to true

Parameters:
Name Type Description
_route String
Source:
To Do:
  • To be Implemented

Navigate Back to Specific View

Parameters:
Name Type Description
_viewId String

View ID

Source:
To Do:
  • To be Implemented

Navigate to Specific View

Parameters:
Name Type Description
_viewId String

View ID

removeActiveMenuElement()

Source:

This method will be implemented by Subclass

render()

Source:

ViewNavigator Lifecycle Method, Call by ViewManager, Render ViewNavigator DOM Content

setActiveMenuElement(_navEvent)

Source:

This method will be implemented by Subclass

Parameters:
Name Type Description
_navEvent string

Navigation Event Name