Skip to content

Instantly share code, notes, and snippets.

@AjayKumar01
Created April 9, 2016 05:53
Show Gist options
  • Save AjayKumar01/5967245498c79af3594b8503dcdd2aac to your computer and use it in GitHub Desktop.
Save AjayKumar01/5967245498c79af3594b8503dcdd2aac to your computer and use it in GitHub Desktop.
({
/*Registering Button action for Keyboard shortcut
* Ajay Kumar
* custom/modules/Accounts/clients/base/views/record/reord.js
*/
extendsFrom: 'RecordView',
initialize: function(options) {
this._super('initialize', [options]);
this.events = _.extend({}, this.events, {
'click a[name=test_button]': '_testAlert',
});
},
_testAlert: function() {
app.alert.show('Validate', {
level: 'info',
messages: 'SugarCRM info message',
autoClose: false,
});
},
registerShortcuts: function() {
app.shortcuts.register('Record:Test', ['t', 'ctrl+alt+t'], function() { //here Record:Test
this.$('.headerpane [data-toggle=dropdown]:visible').click().blur();
this.$('.headerpane [name=test_button]:visible').click(); //clicking the button
}, this);
this._super('registerShortcuts'); //calling super function
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment