open.app.scope.behavior
OpenAppScopeBehavior : d2/sdk/controls/behaviors/open.app.scope.behavior
A Marionette.view
behavior to navigate to an application scope perspective. Whichever view uses
this behavior, waits for a click event to happen. As a reponse to the click event, it opens the application
scope perspective.
A view that has already mixed this behavior, can set a Boolean flag disableAppScopeBehavior=true
to disbale the behavior.
Extends: Marionette.Behavior
Example (To use this behavior in a sample view)
define([
'nuc/lib/marionette',
'd2/sdk/controls/behaviors/open.app.scope.behavior',
'd2/sdk/utils/contexts/context.utils'
], function(Marionette, OpenAppScopeBehavior, contextUtil){
'use strict';
var context = contextUtil.getPerspectiveContext();
var MyView = Marionette.LayoutView.extend({
behaviors: {
AppScope: {
behaviorClass: OpenAppScopeBehavior,
context: context,
applicationScope: 'favorites'
}
},
template: false,
onRender: function() {
this.$el.text('Click me to open favorites');
}
});
});
- OpenAppScopeBehavior :
d2/sdk/controls/behaviors/open.app.scope.behavior
OpenAppScopeBehavior~OpenAppScopeBehavior
Kind: inner class of OpenAppScopeBehavior
new OpenAppScopeBehavior(options, view)
Param | Type | Description |
---|---|---|
options | object | Constructor options, automatically passed by Marionette from behavior configuration of a view |
options.applicationScope | string | Name of the application scope to be opened on click. |
options.context | Context | Reference to the runtime context. See Context. |
[options.registerClickEventListener] | Boolean | Whether the view should add a separate |
view | Marionette.View | The view instance associated with this behavior instance. Automatically set by Marionette. |