Class Index | File Index

Classes


Namespace mmir.env.view.JqmViewEngine


Defined in: jqmViewEngine.js.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
View engine that uses jQuery Mobile for loading the views as new jQM pages.
Method Summary
Method Attributes Method Name and Description
 
Closes a modal window / dialog.
 
Hides / closes the "wait" dialog.
 
Public render function - see #doRenderView
 
JqmViewEngine#showDialog(ctrlName, dialogId, data)
Opens the requested dialog.
 
Shows a "wait" dialog, i.e.
Namespace Detail
mmir.env.view.JqmViewEngine
View engine that uses jQuery Mobile for loading the views as new jQM pages.

The render-functions supports the jQM page-transitions. The default (jQuery Mobile) transition is none.

NOTE: loading the module will in effect load all jQuery Mobile functionality (and its side effects, such as auto-enhancement of HTML elements, e.g. for input/text)

Side Effects

  • loads the jQuery Mobile CSS file
  • loads the RequireJS module "jqm" (i.e.: jQuery Mobile)
  • loads the RequireJS module "jqmSimpleModal" (i.e.: jQuery Mobile plugin SimpleModal)

Replacing the Default ViewEngine

This render engine can be replaced by alternative rendering engines, by
  • implementing the interface for rendering engine: the requirejs module should export an object with the public functions as described by mmir.PresentationManager#_renderEngine.
  • register the engine with its module ID and configure MMIR to use it:
    • register the new rendering-engine file:
      mmir.config({paths: {'module ID': 'path/to/file/name'}})
    • configure MMIR to use it by setting the new module ID to mmir.viewEngine:
      mmir.viewEngine = 'module ID';
    • NOTE: the call to mmir.config and setting the module ID to viewEngine must happen after the mmirf/core.js file is loaded, but before mmirf/vendor/libs/require.js is loaded! (see index.html)
    • NOTE: the path to the app's root directory is ../
    • NOTE: the file name must be without the file extension
//use page-transition with effect 'slide' (animated as not-reversed motion)
mmir.DialogManager.render('theController', 'theView', {transition: 'slide', reverse: false});
Requires:
document (DOM object)
jQuery.Deferred
jQuery.parseHTML
jQuery.appendTo
jQuery#selector
jQueryMobile.defaultPageTransition
jQueryMobile.pageContainer
jQueryMobile.loading
jQueryMobile.pageContainer
jQuerySimpleModalDialog
See:
mmir.PresentationManager#setRenderEngine
mmir.PresentationManager#callRenderEngine
mmir.viewEngine
Method Detail
JqmViewEngine#hideCurrentDialog()
Closes a modal window / dialog.
Requires:
jQuery Mobile SimpleModal
See:
#showDialog
mmir.PresentationManager#showDialog

JqmViewEngine#hideWaitDialog()
Hides / closes the "wait" dialog.
Requires:
jQuery Mobile: $.mobile.loading
See:
#showWaitDialog
mmir.PresentationManager#showWaitDialog

JqmViewEngine#render()
Public render function - see #doRenderView
See:
#doRenderView

{Object} JqmViewEngine#showDialog(ctrlName, dialogId, data)
Opens the requested dialog.
Parameters:
{String} ctrlName
Name of the controller
{String} dialogId
Id of the dialog
{Object} data
Optionally data - not used
Returns:
{Object} the instance of the current dialog that was opened
Requires:
jQuery Mobile SimpleModal
mmir.ControllerManager
See:
#hideCurrentDialog
mmir.PresentationManager#hideCurrentDialog

JqmViewEngine#showWaitDialog(text, theme)
Shows a "wait" dialog, i.e. "work in progress" notification.
Parameters:
{String} text Optional
OPTIONAL the text that should be displayed. If omitted the language setting for loadingText will be used instead (from dictionary.json)
{String} theme Optional
OPTIONAL set the jQuery Mobile theme to be used for the wait-dialog (e.g. "a" or "b"). NOTE: if this argument is used, then the text must also be supplied.
Requires:
jQuery Mobile: $.mobile.loading
mmir.LanguageManager
See:
#hideWaitDialog
mmir.PresentationManager#hideWaitDialog

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Feb 26 2016 21:44:43 GMT+0100 (Mitteleuropäische Zeit)