Overriding the Preview Button in the List view of a module

In the list view of the Leads module, I want to override the action of the preview button next to each record so that clicking on it opens up the preview pane as well as putting the selected row into edit mode.

Platform: Sugar ondemand version 11.1

I am able to override the preview button as below but how do I trigger the 'Edit' action, as if I had clicked on the 'Edit' from the dropdown list next to the preview button?

// custom/modules/Leads/clients/base/views/recordlist.js
*/
({
  extendsFrom: 'RecordlistView',

  initialize: function(options) {
  this._super("initialize", [options]);

  this.context.on('list:preview:fire', this.preview_clicked, this);

},

preview_clicked: function(model) {

  console.log('Preview button clicked');

  //??? trigger/call the editrow action ???

},

Parents Reply Children
  • Thanks Jeff.  I am aware of the edit mode in the preview pane.  That is the predominant way in which records are currently opened and edited.  I just wanted to streamline editing so that clicking on the preview button in the list view opened both the preview pane and the selected row into edit mode.  It's only extra 3 clicks to do these steps manually but it seems like a very simple matter to override a button to do all in one click.  I've arranged the fields in the list view and in the preview pane such that minimal scrolling, if any, is required.  The volume of records that our staff go through each day is quite large so even such a minor task can have a significant impact on our business.