awa.mvc.IFrameModuleView Class
/var/www/azaleahealth.com/branches/docs/source_repo/awa/resources/apps/js/awa/mvc/IFrameModuleView.js:3
The IFrameModuleView is the main view inside of a TabView. Please use the set methods to set the elements of the other sections in the tab view You do have the freedom to not use this view but doing so will allow easier refractoring and a structured way to handle different platforms (varying screen size, mobile, touchscreens, etc.) Provided below is some boilerplate code for creating a new IFrameModuleView.
define(
['awa', '[package_name]/tpl'],
function(awa, tpl){
var NewView = awa.mvc.IFrameModuleView.extend({
constructor: function(options) {
var o = {
tpl: //template here if you choose to have it automated
tplArgs: //template args here if you choose to have it automated
};
options = _.extend(options || {}, o);
NewView.__super__.constructor.call(this, options);
},
render: function() {
var self = this;
NewView.__super__.render.call(this);
// control panel
self.controls = self.addChild("controls", new awa.mvc.ControlsView({
tpl: //controls template
}));
self.controls.render();
self.setControls(self.controls.$el);
self.widgets();
//this method will bind inputs and any fields that have a class that match an attribute of the model to the model
self.bindToModel();
//lets the scrollable widget know the view is done rendering
self.trigger("rendered");
}
});
return NewView;
});
Constructor
awa.mvc.IFrameModuleView
()
Item Index
Methods
Methods
bindToModel
-
[model]
Parameters:
-
[model]awa.mvc.Model | Backbone.Model optionalModel to bind to
Returns:
destroy
()
awa.mvc.View
Returns:
doChildrenLayouts
()
Undefined
Returns:
doLayout
()
Undefined
Returns:
getWidget
()
Array
Returns:
onRendered
-
callback -
context
Parameters:
-
callbackFunctionCallback -
contextObjectDefines scope of callback
Returns:
refresh
()
awa.mvc.View
Returns:
render
()
Undefined
overrides backbone.view's render method. Sets the rendered property to rendered and renders any provided templates. This also binds any buttons in the view to it's action IF it has an actions attribute. The actione attribute value should match the name of the function in the view class.
Returns:
requestChange
-
callback
Parameters:
-
callbackFunctionfunction to call when you have determined if the view can close or not. If it can close, return an object with property 'success' set to 1.
Returns:
requestClose
-
callback
Parameters:
-
callbackFunctionfunction to call when you have determined if the view can close or not. If it can close, return an object with property 'success' set to 1.
Returns:
setElement
-
element -
[delegate]
Parameters:
-
elementJquery.SelectorJquery selector -
[delegate]? optional?
Returns:
triggerRendered
-
args
Parameters:
-
argsObjectparameter to emit
Returns:
viewOptions
()
Array
Returns:
Properties
__parent__
View
Default: undefined
className
Boolean | Function
Default: "awa-mvc-View"
closeOnReplace
Boolean
Default: false
globalKeys
Object
Default: undefined
keys
Object
Default: undefined
refreshOnReplace
Boolean
Default: true
rendered
Boolean
Default: false
title
Strin
Default: "View"
tpl
Function
Default: undefined
tplArgs
Object
Default: undefined