Login | Forgot password | Register
What is OpenID?
OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.
With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.
For more information visit the official OpenID site.
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Javascript Behaviours for DataobjectManager Popup?
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: UncleCheese
|
Page:
1
|
Go to End | |
| Author | Topic: Javascript Behaviours for DataobjectManager Popup? | 603 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
| 603 Views | ||
|
Page:
1
|
Go to Top |
Currently Online: paul.mcilwaine, motly, jondbaker, sicp
Welcome to our latest member: fearofbuttons

