patients.PatientsDocumentsListView Class
Constructor
patients.PatientsDocumentsListView
-
[options.patient]
Parameters:
-
[options.patient]patients.PatientModel optionalIf this is limited to a single patient, pass this in the constructor
Item Index
Methods
- addSelectedDocuments
- attachDocumentListActionsEvents
- attachDragAndDropEvents
- attachEventListeners
- attachGridEvents
- bindToModel
- controlsViewArgs
- destroy
- doChildrenLayouts
- doLayout
- getEventPrefix
- getGridColumns
- getSelectedDocuments
- getWidget
- initialize
- onAssembleDocuments
- onDocumentCheck
- onDocumentListActionSelect
- onRendered
- onSelectAllCharts
- onSelectNoneDocuments
- onShowHideDocumentActions
- popup
- refresh
- removeSelectedDocument
- render
- requestChange
- requestClose
- setElement
- triggerRendered
- unselectAllDocuments
- viewOptions
Methods
addSelectedDocuments
-
$selected
Adds the given inputs to the internal cache of selected rows.
Parameters:
-
$selectedJQueryThe gridrows of the selected documents
Returns:
undefined
attachDocumentListActionsEvents
()
Undefined
Attaches event listeners for the document list actions.
Returns:
undefined
attachDragAndDropEvents
()
Undefined
Attaches drag and drop event listeners to the section view.
Returns:
undefined
attachEventListeners
()
Undefined
Initalizes all event listeners for the view.
Returns:
undefined
attachGridEvents
()
Undefined
Attaches event listeners for the list grid.
Returns:
undefined
bindToModel
-
[model]
Binds the view to a Model. will explain more later.
Parameters:
-
[model]awa.mvc.Model | Backbone.Model optionalModel to bind to
Returns:
controlsViewArgs
()
Create the controls view
destroy
()
Destroy the view. Clean up any global event bus listeners.
doChildrenLayouts
()
Undefined
Needed for height fixing and other positioning changes
Returns:
doLayout
()
Undefined
Needed for height fixing and other positioning changes
Returns:
getEventPrefix
()
String
Formats the string prefix for the global event name.
Returns:
A prefix identifying the patient (if available)
getGridColumns
()
Array
Gets the grid column configuration.
Returns:
A list of columns in this grid
getSelectedDocuments
()
Array
Returns an array of chart IDs that are currently selected, or it returns an empty array.
Returns:
A list of documents selected
getWidget
()
Array
get the view controlling a widget by it's selector
Returns:
widgets
initialize
()
Initialize the view.
onAssembleDocuments
()
Undefined
Send the selected documents to document assembler
Returns:
undefined
onDocumentCheck
-
el
Called when the user clicks a checkbox in the documents grid
Parameters:
-
elElementthe element to be used
Returns:
undefined
onDocumentListActionSelect
-
value
Called when the user select an action in the check / select menu
Parameters:
-
valueStringA string describing which type of selection wos made
Returns:
undefined
onRendered
-
callback -
context
This is called only once in the lifetime of a view, if you bind to it before the view is rendered, the function will be called after triggerRendered is called.
Parameters:
-
callbackFunctionCallback
-
contextObjectDefines scope of callback
Returns:
onSelectAllCharts
()
Undefined
Selects all document rows in the current grid view
Returns:
undefined
onSelectNoneDocuments
()
Undefined
Un-selects all document rows in the current grid view
Returns:
undefined
onShowHideDocumentActions
()
Undefined
Determines whether or not the document actions should be shown or hidden
Returns:
undefined
popup
-
[createArgs]
Parameters:
-
[createArgs]Object optionalarguments used on creation of popup
-
[controlsOnTop]Boolean optionaldefaults to false
-
[x]Integer optionaldefaults to false
-
[y]Integer optionaldefaults to false
-
[onRender]Function optionaldefaults to false
-
Returns:
popup
refresh
()
awa.mvc.View
There is a habit of re-rendering entire views when it may not be necessary. Parent views can check the rendered flag and call refresh instead if the child view has already been rendered.
Returns:
this
removeSelectedDocument
-
id
Removes the chart with the given id from the internal cache of selected rows
Parameters:
-
idInteger | StringThe id of the document to remove
Returns:
undefined
render
()
Undefined
Render the view.
Returns:
undefined
requestChange
-
callback
Parent views should check this before changing/swapping a view. Useful for views that are in edit mode that you want to do confirmation before leaving.
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
Parent views should check this before closing a view. Useful for views that are in edit mode that you want to do confirmation before closing.
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]
Overidden setElement method applies the className to the new element the view is applied to. Also, if multiple views are passed in (what is returned from a jquery selector) it will be the top of the list.
Parameters:
-
elementJquery.SelectorJquery selector
-
[delegate]? optional?
Returns:
triggerRendered
-
args
The view should only call this once its completely rendered. This does not include refreshing views (i.e. grids changing pages). This also sets the view's rendered property to true.
Parameters:
-
argsObjectparameter to emit
Returns:
unselectAllDocuments
()
Undefined
Unselects all charts from the grid and updates the internal cache of selected rows.
Returns:
undefined
viewOptions
()
Array
the constructor uses this function to determine which properties to pull out of the passed in options to directly attach to the view. All other options can be referenced from the view's options property
Returns:
Acceptable view options
Properties
__parent__
View
Parent view object
Default: undefined
className
Boolean | Function
when this view is rendered, it will create a new element with this class added. If the setElement method is used, this will append itself to the class attribute
Default: "awa-mvc-View"
closeOnReplace
Boolean
Mostly for views that contain multiple views. This allows a parent view to know that the view should be closed and destroyed when another view is swapped in.
Default: false
controlsView
awa.mvc.ControlsView
reference to this contentsView's main controls view. Subsequent controls view will have to be managed another way.
Default: undefined
globalKeys
Object
used for the keymaster plugin. These will be scoped to the entire app.
Default: undefined
keys
Object
used for the keymaster plugin. These will be scoped to this view in the future.
Default: undefined
ModelClass
Constructor
provide model class to derive information from and to fill data
Default: undefined
refreshOnReplace
Boolean
Mostly for views that contain multiple views. This allows a parent view to know that the view should be refreshed when this view is swapped back in.
Default: true
rendered
Boolean
Lets you know if this view object has been rendered or not. If you override the render method without doing a supercall, be sure to set it to true when you are done rendering.
Default: false
title
Strin
Can be used by parent views to put on tabs, control bars, popup headers, etc. Use accessor methods.
Default: "View"
tpl
Function
default template to use with this view, the render method will use this and inject the resulting html into it's $el.
Default: undefined
tplArgs
Object
arguments that are passed to the template
Default: undefined
viewDescription
String
Description for use of view. May also explain a concept. Intended for the user. If set, the content view rendering process will decide where to place his content if needed.
Default: undefined