Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Loading JS-Requirements to ModelAdmin-DOM-Popup


Go to End


1026 Views

Avatar
Lukin

Community Member, 56 Posts

8 November 2011 at 12:33am

HI,

I need some js behaviour in the PopUp-View of a DataOject.
Scenario:

ModelAdmin
+ manages Kategorien
+ Has ManyMany Typs
The Typ-Objects are listed in a DOM-Element
When clicking on an entry of the DOM / or pushing the Add-Button I get the PopUp to Edit or Create my Typ-Object.

I want to Add a javascript Behaviour to that view. I tried to add the js to the popup-view like this:

I put Requirements::javascript("Typ.js");
into the getMCSFields_forPupup function.

The js is now loading. (i put an alert into the jsfile to check), but the behaviour does not seem to be applied to the html-dom-element.
Might be cause the popup view is an iframe or something??

So... Question:

<b>How to put extra-behaviour to the popup-view defined by getcmsfields_forpopup?</b>

Thaks in advance

cheers Lukin