7911 Posts in 1354 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Javascript Behaviours for DataobjectManager Popup?
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1668 Views |
-
Javascript Behaviours for DataobjectManager Popup?

24 June 2009 at 12:22pm Last edited: 24 June 2009 12:26pm
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 -
Re: Javascript Behaviours for DataobjectManager Popup?

24 June 2009 at 2:25pm
DataObjectManager doesn't work with the Behavior class, so it gets blocked. You'll have to assign the behaviors using JQuery.
-
Re: Javascript Behaviours for DataobjectManager Popup?

24 June 2009 at 7:51pm
Thanks Uncle Cheese! I really appreciate your support and fantastic modules.
Cheers!
Anatol -
Re: Javascript Behaviours for DataobjectManager Popup?

4 August 2010 at 3:59am
I'm curious about where I should add the javascript if I don't want to go in and mess with the code in the DOM module?
| 1668 Views | ||
|
Page:
1
|
Go to Top |

