Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » drag & drop reordering not working

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 3091 Views
  • keeny
    Avatar
    Community Member
    48 Posts

    drag & drop reordering not working Link to this post

    Hi all,

    I've been using dataobject manager for a while now with no problem. On one particular site (SS2.3.3 dataobject r206) I have a problem with drag and drop.

    On a page with a dataobject manager, I can see the checkbox to allow reordering. But when I click it, I am unable to drag anything around.

    However! Drag and drop reordering works fine in the 'Files & Images' section.

    I'm adding the manager the way I've done countless times before...

    $fields->addFieldToTab("Root.Content.TestObjects", new DataObjectManager(
             $this,
             'TestObjects',
             'TestObject',
             array(
                'Name' => 'Name',
                ),
             'getCMSFields_forPopup'
          ));

    Anyone have any ideas?

    Cheers,

    Barry.

  • keeny
    Avatar
    Community Member
    48 Posts

    Re: drag & drop reordering not working Link to this post

    Okay - I've narrowed down the problem.

    I have an ImageDataObjectManager (ImageDOM) field and a DataObjectManager (DOM) field in seperate tabs on a Page.

    If the ImageDOM is added before the DOM then drag & drop wont work on the DOM. The DOM must be added to getCMSFields first.

    Can anyone recreate this problem? Is this a bug?

  • UncleCheese
    Avatar
    4085 Posts

    Re: drag & drop reordering not working Link to this post

    I have heard this bug reported before, but I have never been able to replicate it. I'll do some more testing. I'm sure it's something simple.

  • keeny
    Avatar
    Community Member
    48 Posts

    Re: drag & drop reordering not working Link to this post

    Thanks Uncle Cheese - appreciate the help!

  • keeny
    Avatar
    Community Member
    48 Posts

    Re: drag & drop reordering not working Link to this post

    I'm also having problems adding more than one ImageDOM to a page. I get the error:

    Fatal error: Call to a member function Icon() on a non-object in C:\wamp\www\palms\dataobject_manager\code\ImageDataObjectManager.php on line 70

    Is is generally a bad idea to be adding more than one ImageDOM to a page?

    Thanks,

    Barry.

  • UncleCheese
    Avatar
    4085 Posts

    Re: drag & drop reordering not working Link to this post

    No, that's an unrelated error. Sounds like you may have deleted the file associated with a record?

  • keeny
    Avatar
    Community Member
    48 Posts

    Re: drag & drop reordering not working Link to this post

    Hmm - well I cleaned out all records and then uploaded some new images but still got the error. It worked fine on normal pages which only have one ImageDOM, but the HomePage had two ImageDoms.

    I modified the HomePage to use one ImageDOM and one DOM (with thumbnail) but I would've preferred to use two ImageDOM's.

    Phew!... all these Dom-Dom-Dom's sound like ominous background music.

  • keeny
    Avatar
    Community Member
    48 Posts

    Re: drag & drop reordering not working Link to this post

    Hi again uncle,

    I'm having more drag & drop woes. I'm using trunk version of DOM.

    Now when I go to drag something in a DOM, the page just keeps expanding downwards. There's slightly different, but equally bizarre behaviour in the ImageDOM.

    To fix I just uncommented DataObjectManager.php (line 72)

          Requirements::javascript('dataobject_manager/javascript/jquery-ui.1.5.3.js');

    Must be some kindof incompatibilty in the sortable function between 1.5 and later versions? Sorry - I wouldn't know where to start if I wanted to update your jquery calls to the 1.7 versions. Perhaps you could point me in the right direction?

    Cheers,

    Barry.

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