Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » $ is not a function

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2 3
Go to End
Author Topic: 3567 Views
  • UncleCheese
    Avatar
    4085 Posts

    Re: $ is not a function Link to this post

    It's because you're using tabs. I have a jQuery tabset floating around here somewhere.. let me look around and I'll post it.

  • Mad_Clog
    Avatar
    Community Member
    78 Posts

    Re: $ is not a function Link to this post

    Removing the tabs did indeed solve the issue.
    Thanks a lot, it was doing my head in.
    A working variant of TabSet and Tab would be much appreciated!

  • UncleCheese
    Avatar
    4085 Posts

    Re: $ is not a function Link to this post

    http://carlinowebdesign.com/tabs.zip

    Place in a folder named "tabs", and run a flush.

    Example code:

    return new FieldSet(
       new HorizontalTabSet("Root",
          new Tab('Info',
          new TextField('Name')
       ),
       new VerticalTabSet('Schools',
          new Tab('DOM',
              new DataObjectManager(
                 $this,
                 'Schools',
                 'School',
                 array('Name' => 'Name', 'Year' => 'Year', 'Degree' => 'Degree')
              )
           ),
           new Tab('Bio',
              new TextareaField('Bio')
           )   
       ),
       new Tab('RandomThings',
             new CheckboxSetField('RandomThings','Random things',DataObject::get("RandomThing")->toDropdownMap('ID','Foo'))
       )
    )
    );

    Notice that for nested tabsets, you can use VerticalTabSet to hide and show fields on click from within a horizontal tab.

    Haven't tested in 2.4, and just made a fix that should help. Let me know how that works for you.

  • Mad_Clog
    Avatar
    Community Member
    78 Posts

    Re: $ is not a function Link to this post

    Thanks UC, those tabs do play nice with DOM.
    Why don't you bundle them with your DOM release(s)?
    Doubt I'm the only person using tabs in combination with DOM.

  • UncleCheese
    Avatar
    4085 Posts

    Re: $ is not a function Link to this post

    Cause I assumed they didn't work! Glad to hear it's working for you. I think I will roll that in and let people play around with it.

  • JL
    Avatar
    Community Member
    10 Posts

    Re: $ is not a function Link to this post

    The HorizontalTabSet is great, solve my "$ is not a function" too. The new look & feel for the tabs blends well with the popup!

  • escaped
    Avatar
    Community Member
    6 Posts

    Re: $ is not a function Link to this post

    i stumbled upon this and i must say that this is really really great.

    So I just wanted to inform you, that these tabs interfiere with Uploadify - so you have to use FileIFrameField.

  • maurirp
    Avatar
    Community Member
    2 Posts

    Re: $ is not a function Link to this post

    It's a conflict with jQuery and I solved it this way...
    - Modified the file imagegallerymanager_popup.js in folder image_galery/javascript this way:

    $.noConflict();

    jQuery(function() {
       jQuery('.rotate-controls a').click(function() {
          link = $(this).attr('href');
           jQuery.ajax({
           url: link,
           success: function(html){
              jQuery('#preview-image img.preview').attr('src', html);
           }
          
          });
          return false;
       });
    });

    jQuery().ajaxSend(function(r,s){
    jQuery(".ajax-loader").slideDown();
    });

    jQuery().ajaxStop(function(r,s){
    jQuery(".ajax-loader").slideUp();
    });

    After this modification, '$ is not a function' error gone, and uploads begin to function as usual....

    3567 Views
Page: 1 2 3
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.