view.Base Class
Extends
Item Index
Methods
Methods
_init
-
callback
Parameters:
-
callback
Function
_isBound
-
checkId
has the data been bound
Parameters:
-
checkId
Boolean[default=false] optional - if true it will also check that the target it bound with the current view and not just generally bound to
Returns:
_render
-
those
Parameters:
-
those
Objectof Firebrick.views.renderTo
_renderHTML
-
html
Parameters:
-
html
String
Returns:
self
bind
()
Called by view.Base:render()
bindContent
()
detroy
()
Object
unbind and remove from DOM
Returns:
self
getData
()
Object
Returns data store data as object
Returns:
getEnclosedBindId
()
String
Returns:
getEnclosedTarget
()
JQuery Object | Null
Returns:
getStore
()
Returns the store linked to the view
getTarget
()
Object | Null
Returns:
jquery object
hide
()
hide target view.Base:getTarget
init
()
Called on creation
initStore
-
Firebrick.view.Base
Converts View data into a Store if not already done
Parameters:
-
Firebrick.view.Base
Objectobject
Returns:
self
initSubViews
()
private
initView
()
Object
Construct the view with template and data binding
Returns:
self
isTargetBound
()
Boolean
has data been bound to the target by THIS view
Returns:
isTargetBound
()
Boolean
has data been bound to the target by A|ANY view
Returns:
isVisible
()
prepHtml
()
String
prepare the HTML for rendering
Returns:
html
remove
()
Object
remove from dom
Returns:
self
render
()
Object
Calls renderTo without parameters
Returns:
self
setDisposeCallback
-
el
Parameters:
-
el
HTMLElement
show
()
show target view.Base:getTarget
startLoader
()
private
stopLoader
()
private
unbind
()
Object
unbind the data from this view
Returns:
self
unbound
()
private
called by view.Base:setDisposeCallback
update
-
data
update the view with new data
Parameters:
-
data
Objectextra data you wish to pass to the view
Returns:
self
Properties
_state
String
private
State the view is current in. "initial", "rendered", "unbound", "destroyed"
Default: "initial"
animations
$.show() Arguments
Default: null
appendTarget
Boolean
whether to append or overwrite the content of the target
Default: false
applyBindingsToDescendants
Boolean
bindings are applied to its decendants, not on the target itself
Default: false
async
Boolean
whether or not the template is to load asyncronously
Default: true
autoRender
Boolean
render the view on class creation
Default: true
bindAttribute
String
custom attribute to add to the element to mark as bound
Default: "fb-view-bind"
controller
String | Object name of the controller | | controller class itself
controller to bind to the view
Default: null
enclosedBind
Boolean
wrap the view inside its own div which gets bound separatly to its context
Default: false
enclosedBindIdPrefix
String
Default: "fb-enclosed-bind-"
html
String html
parsed html using the tpl and data
Default: ""
isView
Boolean
private
boolean whether class is view
loading
Boolean
private
whether the loader is being shown or not
Default: false
loadingTpl
String
loading template - loaded into target is showLoading == true
Default: Firebrick.templates:loadingTpl
showLoading
Boolean
whether to show that the view is loading
Default: true
store
String | Store Object
bind a store or plain data to the view
Default: null
subViews
String | Array of Strings | Object | Array of Objects
define subviews to load after creation of this view
Example:
subViews: MyApp.view.MyView
subViews: ["MyApp.view.MyView", "MyApp.view.MyView1"]
subViews: Firebrick.defineView(...)
subViews: [Firebrick.defineView(...), Firebrick.defineView(...)]
target
String | Object jquery selector | | jquery object
Target to which to render the html content
Default: null
tpl
String
set when the view is loaded by the ajax request
Default: ""