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.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

including javascript file to popup dataobject_manager


Reply

3 Posts   903 Views

Avatar
snaip

8 March 2011 at 10:45pm Community Member, 180 Posts

i want to add my own javascript file to dataobject_manager popup

in DataObject_Manager.php add

Requirements::javascript('dataobject_manager/javascript/test.js');

test.js

(function($) {

alert('start');

var option = $('#DataObjectManager_Popup_AddForm_FileID option:selected').text();
alert(option);
})(jQuery);

the alert is shown when i reload the CMS but the next rules doesn't work

also this rule doesn't work too

$('.footer').css('background-color','#000');

.footer --> footer div of dataobject_manager popup

Avatar
snaip

9 March 2011 at 9:25pm Community Member, 180 Posts

any idea ?

Avatar
UncleCheese

10 March 2011 at 3:30am 4085 Posts

I would think you'd put it in the getCMSFields() function for your dataobject, right? DataObjectManager is not the right controller for the popup.