Class: ViewNavigator

ViewNavigator(_id, _parentIdopt)

ViewNavigator

Extends

  • EventDispatcher

Constructor

new ViewNavigator(_id, _parentIdopt)

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 View4Js supports multiple history stack too. ViewNavigator also Manages LifeCycle of View.
Parameters:
Name Type Attributes Default Description
_id String ViewNavigator ID
_parentId String <optional>
null Parent ID View or "root" DOM Element
Source:
To Do:
  • {Boolean} navigationHistory - Enable or Disable Navigation History. If true ViewNavigator will keep View History.

Members

Name Description
eventRouter Returns EventRouter instance of ViewNavigator
eventRouter Set EventRouter for ViewNavigator, EventRouter is useful for EventBased Navigation and for navigation of single view or multiple views.
history Sets Navigation History Boolean Property , returns True if Component is Enabled


Methods

Name Description
createView By Default View class will be created When Overrides by Subclass , custom Views will be created
createViewStack By Default ViewStack class will be created When Overrides by Subclass , custom Viewstack will be created
destroy 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 Get ViewObject by ViewId
getViewStack Get ViewStack Object by ViewStackId
initNavigator Implemented by Subclass Call by ViewNavigator Constructor
navigate Call by ViewManager Navigation Route and Navigation EventRoute Combination must be unique
navigateBack Call by ViewManager or ViewNavigator internally Navigate back to previous View if history set to true
navigateBackToView Navigate Back to Specific View
navigateToView Navigate to Specific View
removeActiveMenuElement This method will be implemented by Subclass
render ViewNavigator Lifecycle Method, Call by ViewManager, Render ViewNavigator DOM Content
setActiveMenuElement This method will be implemented by Subclass


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

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
Source:
Returns:
- View Instance
Type
Object

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

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
Source:
Returns:
- ViewStack Instance
Type
Object

destroy()

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
Source:

getView(_viewId) → {Object}

Get ViewObject by ViewId
Parameters:
Name Type Description
_viewId string ViewID
Source:
Returns:
- View Instance
Type
Object

getViewStack(_viewStackId) → {Object}

Get ViewStack Object by ViewStackId
Parameters:
Name Type Description
_viewStackId String ViewStackID
Source:
Returns:
- ViewStack Instance
Type
Object

initNavigator()

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:
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
Source:
To Do:
  • To be Implemented

removeActiveMenuElement()

This method will be implemented by Subclass
Source:

render()

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

setActiveMenuElement(_navEvent)

This method will be implemented by Subclass
Parameters:
Name Type Description
_navEvent string Navigation Event Name
Source: