View is a type in FrameworkJS that users can define the new Views. View is to show and hide a content inside a page. Pay attention, views do not close like pages do; instead, they are shown or hidden within pages.
It is possible to include a view in a page block of HTML or place it outside and show/hide it similar to popup boxes.
var viewName = new View('viewName', function () {
// after view shown
}, function () {
// before view shown
}, function () {
// after view hidden
}, function () {
// before view hidden
});
Type:
Object
the var viewName
is an instance of View
that defined for every view.
therefore each view has a name in its first parameter that is the same as the name variable, but without the "View" keyword.
Parameters | Type | Description |
---|---|---|
name | String | The name of the view, so every view has the own specifice and unique name |
after view show | function | The operation that need to be shown after showing view. |
before view shown | function | Before the view is going to be shown, the operations will be here to run. | after view hidden | function | The operation that should be executed after closing the view. |
before view hidden | function | The operation that should be executed before closing the view. |
var homeView = new View('home', function () {
// after view shown
}, function () {
// before view shown
}, function () {
// after view hidden
}, function () {
// before view hidden
});