AnsweredAssumed Answered

How to add events to buttons in custom views in Sugarcrm 7.2.x?

Question asked by Jeroen Somhorst on Sep 5, 2014
Currently for customer work we place a buttons in custom or customized layouts and controllers. The current strategy we use is to use the events object to couple the object to the event, but this does not work very well when you have a list of items rendered as a table and each row has actions where you want to add the data of that row to. Also for example in the record view you can add a button under the buttons key, and you add an action to it using this.context.on(..) in the record.js controller (or the extension). Also I've seen a this.on(..) construction, as well as adding a data-action to your element, so it's all a bit confusing.

So I'm looking for best practices for adding events to custom buttons in the following situations:
  • Single button with a single action in a dashlet
  • Single button with a single action in a custom view and controller
  • Buttons in a table, and preferably having the opportunity to have the row information available in the action
Thanks in advance!

Outcomes