Hi,
I'm trying to add a JavaScript behaviour to the DataobjectManager Popup like this:
Behaviour.register({
'#DataObjectManager_Popup_DetailForm_MediaType': {
onchange: function() {
alert('changed'); // more useful code here
},
initialize: function() {
this.onchange();
}
}
});
I'm not quite sure where to add the JavaScript file:
Requirements::javascript('mysite/javascript/eventbehaviours.js');
After some failed attempts I added it to the DataObjectManager_Popup class in DataObjectManager.php and at least I get an error message that says: "Behaviour is not defined". Where do I need to add the required JavaScript file? I guess the problem is that it has to come after /jsparty/behaviour.js but wherever I put it it appears earlier in the HTML code.
Cheers!
Anatol