Extends
- EventDispatcher
Constructor
new Component(_idopt, _parentViewIdopt, _parentContainerIdopt, _createDOMElementopt)
Creates an instance of Component.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
_id |
string |
<optional> |
null | ComponentID |
_parentViewId |
string |
<optional> |
null | Component Parent View ID |
_parentContainerId |
string |
<optional> |
null | Component Parent Container ID |
_createDOMElement |
boolean |
<optional> |
true | True if Component DOM element create from Template , False if taken from DOM. |
- Source:
Members
Name | Description |
---|---|
componentElement | returns Component DOM Element |
currentState | returns Component current state |
enabled | Boolean Property , returns True if Component is Enabled |
parentContainer | returns Parent Container ID |
parentView | returns ParentViewID |
readOnly | returns True if Component is ResdyOnly |
required | returns True if Component is Required |
visible | Boolean Property , returns True if Component is Visible |
Methods
Name | Description |
---|---|
addEventHandler | Add Event Handlers for Component DOM Elements and Model Call by attach & set domElement Method |
addToComponentElement | Add Component Content DOM Element to Component |
attach | Component Lifecycle Method Call by View or call manually attach Responsible to render component content, listners etc Dispatch "ATTACHED_EVENT" when view got attached / rendered Following methods call by attach method createDOMContent addViewHandler bind |
bind | Overrides by SubClass Bind Component Properties with Model or other Components call by attach & view |
changeComponentState | change Component State Overrides by Subclass |
changeState | change Component State |
createDOMContent | creates DOM Contents of Component Overrides by SubClass Call by attach Method |
destroy | Overrides by SubClass Destroy Method used to cleanup component resources Call by View or call manually to destroy view Remove Event Handlers, Make Properties null, Remove DOM Element contents and its reference. |
detach | Component Lifecycle Method Call by View or call manually Component will be remove if Component is attached |
init | Initialise Component properties and model Call by View or Parent |
initComponent | call by init method |
refresh | Refresh Component data and model and event listners Overrides by SubClass |
removeEventHandler | Remove Event Handlers for Component DOM Elements and Model call by destroy method |
setComponentEnabled | Overrides by Subclass |
setComponentReadOnly | Overrides by Subclass |
setComponentRequired | Overrides by Subclass |
unBind | Overrides by SubClass Remove Bind on Component Properties with Model or other Components |
addEventHandler()
Add Event Handlers for Component DOM Elements and Model
Call by attach & set domElement Method
- Source:
addToComponentElement(_tmpCompContentEl)
Add Component Content DOM Element to Component
Parameters:
Name | Type | Description |
---|---|---|
_tmpCompContentEl |
string | DOMElement |
- Source:
attach()
Component Lifecycle Method
Call by View or call manually
attach Responsible to render component content, listners etc
Dispatch "ATTACHED_EVENT" when view got attached / rendered
Following methods call by attach method
createDOMContent
addViewHandler
bind
- Source:
bind()
Overrides by SubClass
Bind Component Properties with Model or other Components
call by attach & view
- Source:
changeComponentState()
change Component State
Overrides by Subclass
- Source:
changeState()
change Component State
- Source:
createDOMContent()
creates DOM Contents of Component
Overrides by SubClass
Call by attach Method
- Source:
destroy()
Overrides by SubClass
Destroy Method used to cleanup component resources
Call by View or call manually to destroy view
Remove Event Handlers, Make Properties null,
Remove DOM Element contents and its reference.
- Source:
detach()
Component Lifecycle Method
Call by View or call manually
Component will be remove if Component is attached
- Source:
init()
Initialise Component properties and model
Call by View or Parent
- Source:
initComponent()
call by init method
- Source:
refresh()
Refresh Component data and model and event listners
Overrides by SubClass
- Source:
removeEventHandler()
Remove Event Handlers for Component DOM Elements and Model
call by destroy method
- Source:
setComponentEnabled()
Overrides by Subclass
- Source:
setComponentReadOnly()
Overrides by Subclass
- Source:
setComponentRequired()
Overrides by Subclass
- Source:
unBind()
Overrides by SubClass
Remove Bind on Component Properties with Model or other Components
- Source: