Skip to content

Instantly share code, notes, and snippets.

@AjayKumar01
Last active October 3, 2016 20:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AjayKumar01/ae01ef466966d4b8a8e20d41bbf54b68 to your computer and use it in GitHub Desktop.
Save AjayKumar01/ae01ef466966d4b8a8e20d41bbf54b68 to your computer and use it in GitHub Desktop.
({
/*Disabling button ,condition based or dynamically on RecordView.
* AjayKumar
* custom/modules/Accounts/clients/base/views/record/reord.js
*/
extendsFrom:'RecordView',
initialize:function(options){
this._super('initialize',[options]);
this.on('render',this.makedisableButton,this);
},
makedisableButton:function(){
var accountType,editButton,checkButton;
editButton=this.getField('edit_button'); // passing argument as name of button
checkButton=this.getField('check_button');
AccountType=this.model.get('account_type');
if (editButton && checkButton && _.isEqual(AccountType,'Customer')) {
editButton.setDisabled(true);
checkButton.setDisabled(true);
}
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment