Created
April 9, 2016 05:53
-
-
Save AjayKumar01/5967245498c79af3594b8503dcdd2aac to your computer and use it in GitHub Desktop.
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
({ | |
/*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