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   943 Views

Avatar
snaip

Community Member, 180 Posts

8 March 2011 at 10:45pm

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

Community Member, 180 Posts

9 March 2011 at 9:25pm

any idea ?

Avatar
UncleCheese

Forum Moderator, 4096 Posts

10 March 2011 at 3:30am

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