Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » including javascript file to popup dataobject_manager

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 889 Views
  • snaip
    Avatar
    Community Member
    180 Posts

    including javascript file to popup dataobject_manager Link to this post

    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

  • snaip
    Avatar
    Community Member
    180 Posts
  • UncleCheese
    Avatar
    4085 Posts

    Re: including javascript file to popup dataobject_manager Link to this post

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

    889 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.