Skip to content

Instantly share code, notes, and snippets.

@AjayKumar01
Created April 9, 2016 08:39
Show Gist options
  • Save AjayKumar01/a9e217b8b4e20bf09d03b906f5fad21b to your computer and use it in GitHub Desktop.
Save AjayKumar01/a9e217b8b4e20bf09d03b906f5fad21b to your computer and use it in GitHub Desktop.
Hiding fields in create view of module
({
/* Hiding fields in create view of opportunities module
* Ajay Kumar
* Path : custom/modules/Opportunities/clients/base/views/create-actions/create-actions.js
*/
extendsFrom: 'CreateActionsView',
initialize: function(options) {
this._super('initialize', [options]);
this.on('render', this.hideField, this);
},
hideField: function() {
_.each(this.fields, function(field) {
if (_.isEqual(field.def.name, 'sales_stage')) {
//~ field.hide();
this.$('[data-name=sales_stage]').css('visibility', 'hidden');
}
}, this);
}
})
@AjayKumar01
Copy link
Author

field.hide();
This also will work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment