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
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.
There are different ways to achieve this
this.on('field_name', this.functionName, this);