Created
October 16, 2015 22:40
-
-
Save mmarum-sugarcrm/e6f29fbde5db0264bab4 to your computer and use it in GitHub Desktop.
Contextual Frame Dashlet javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
/** | |
* Copyright 2015 SugarCRM Inc. Licensed by SugarCRM under the Apache 2.0 license. | |
*/ | |
plugins: ['Dashlet'], | |
/** | |
* Record ID that is in context | |
*/ | |
record: undefined, | |
/** | |
* Module used | |
*/ | |
moduleName: undefined, | |
/** | |
* Base URL for iFrame (retrieved via config) | |
*/ | |
url: undefined, | |
/** | |
* Height for iFrame element | |
*/ | |
frameHeight: undefined, | |
/** | |
* Overriding initDashlet to setup values needed to render our contextual dashlet | |
*/ | |
initDashlet: function(view) { | |
var ctx = this.context; | |
var model = ctx.get("model"); | |
if (!_.isEmpty(model)) { | |
this.record = ctx.get("model").get("id"); | |
} | |
this.moduleName = ctx.get("module"); | |
this.url = this.settings.get("url"); | |
this.frameHeight = this.settings.get("frameHeight"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment