Created
April 9, 2016 07:20
-
-
Save AjayKumar01/e4f2ca6552e857ca657b4eebefea1ec4 to your computer and use it in GitHub Desktop.
Disabling create and link existing button action in subpanel based on parent module.
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
({ | |
/* Disabling create and link existing button action in subpanel based on parent module. | |
* Ajay Kumar | |
* Path : sugar/custom/modules/Leads/clients/base/views/panel-top/panel-top.js | |
*/ | |
extendsFrom: 'PanelTopView', | |
initialize: function(options) { | |
this._super('initialize', [options]); | |
var industryValue = this.context.parent.get('model').get("industry"); | |
var parentModule = this.context.parent.get('module'); | |
if (!_.isEqual(industryValue, 'Construction') && _.isEqual(parentModule, "Accounts")) { | |
_.each(_.first(this.meta.buttons).buttons, function(action) { | |
action['css_class'] = 'disabled btn'; | |
}); | |
} | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment