3

How can we capture user events in dom from record.js in Sugar CRM 7.5?

For example: I have a select box in sugar CRM 7.5 record view. On change of this list i need to hide/show some fields in the interface.

Thanks in advance

Jpec
  • 300
  • 2
  • 14

2 Answers2

2

while in record.js you have access to the model object, which is the javascript representation of SugarCRM's Bean object

The SugarCRM model is an extension of a backbone.js model and you can and should use Backbone Events

in record.js :

initialize : {
     /** initialize code **/
     this.model.on('change:title' , function () {/*...*/})
}

However as mentioned beforethere are simpler ways to accomplish this without any javascript or PHP. Please see the studio tool located in the administration panel.

paquino
  • 464
  • 2
  • 5
1

There are different ways to achieve this

  • You can make your fields dependent if you only want to show hide the fields Ref
  • You can register your events in initialize function of record view controller file of your module see the sample code

this.on('field_name', this.functionName, this);