mmir.env.view.StubViewEngine
Stub for view/rendering engine:
mocks the function calls and invokes the hooks on the controllers without actually rendering anything.
Example
mmir.present.render('theController', 'theView');
Methods
-
doRenderView(_ctrlName, viewName, view, ctrl, data){Promise}
-
Actually renders the View.
Fetches the layout for the controller, then fills the layout-template with the view content, while incorporating partials and contents that helper methods have provided. Then Dialogs are created and the pageContainer id is updated. At last all the content is localized usingmmir.LanguageManager#translateHTML
, and appended to the HTML document of the application, while the old one is removed.
At the end the on_page_load action is performed.Name Type Description _ctrlName
String Name of the controller viewName
String Name of the view to render view
Object View object that is to be rendered ctrl
Object Controller object of the view to render data
Object optional optional data for the view. Returns:
Type Description Promise a Promise that gets resolved when rendering is finished -
hideCurrentDialog()
-
Closes a modal window / dialog.
* -
hideWaitDialog()
-
Hides / closes the "wait" dialog.
-
render(_ctrlName, viewName, view, ctrl, data){Promise}
-
Actually renders the View.
Fetches the layout for the controller, then fills the layout-template with the view content, while incorporating partials and contents that helper methods have provided. Then Dialogs are created and the pageContainer id is updated. At last all the content is localized usingmmir.LanguageManager#translateHTML
, and appended to the HTML document of the application, while the old one is removed.
At the end the on_page_load action is performed.Name Type Description _ctrlName
String Name of the controller viewName
String Name of the view to render view
Object View object that is to be rendered ctrl
Object Controller object of the view to render data
Object optional optional data for the view. Returns:
Type Description Promise a Promise that gets resolved when rendering is finished -
showDialog(_ctrlName, _dialogId, _data){Object}
-
Opens the requested dialog.
Name Type Description _ctrlName
String Name of the controller _dialogId
String Id of the dialog _data
Object Optionally data - not used Returns:
Type Description Object the instance of the current dialog that was opened -
showWaitDialog(_text, _theme)
-
Shows a "wait" dialog, i.e. "work in progress" notification.
Name Type Description _text
String optional OPTIONAL the text that should be displayed. If omitted the language setting for loadingText
will be used instead (from dictionary.json)_theme
String 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.