Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Preview: DataObjectManager module

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Go to End
Author Topic: 60167 Views
  • Chucky2k
    Avatar
    Community Member
    32 Posts

    Re: Preview: DataObjectManager module Link to this post

    Thanks UncleCheese, checked out the latest and with your tip, that worked perfectly. I only have one small issue now,

    I added

    SortableDataObject::add_sortable_class('Resource');

    to the _config.php file and I can see the Allow Drag & Drop reordering tick box but any reordering that I do is not reflected when viewing the page and if I edit another page in the CMS and come back, the original order is back.

    Thanks again

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: DataObjectManager module Link to this post

    Did you run a /db/build after adding the sortable class? it needs to add a SortOrder column to the object. My guess is after you sort, the AJAX request is failing because it can't find that column.

    And needless to say, when you display on the frontend, don't have an order clause in your query. It will order by SortOrder by default.

  • Chucky2k
    Avatar
    Community Member
    32 Posts

    Re: Preview: DataObjectManager module Link to this post

    After retracing my steps, it hit me. I added the sortable class after adding the resources to the database. Totally makes sense why it wont sort now.

    Thanks for your patience.

  • Bo_Einzeller
    Avatar
    Community Member
    18 Posts

    Re: Preview: DataObjectManager module Link to this post

    I have a subdirectory in my localhost, something like http://localhost/silverstripe_2_3_0/.
    In silverstripe 2.3.0 rc3 some files aren't found. So i had do delete the leading slashes of directories. The director is forced to take the whole path do build an absolute url.
    These files are affected:
    facebox.js (Line82): loadingImage : 'dataobject_manager/images/loading.gif',
    facebox.js (Line83): closeImage : 'dataobject_manager/images/closelabel.gif',
    dataobject_manager.js (Line70): $j.post('DataObjectManager_Controller/dosort/' + do_class, $list.sortable("serialize"));

    swfupload/_config.php (Line35): 'flash_url' => Director::absoluteURL('swfupload/javascript/swfupload.swf'),
    swfupload/_config.php (Line45): 'button_image_url' => Director::absoluteURL('swfupload/images/XPButtonNoText_160x22.png'),

    In css-Files replace /dataobject_manager/images with ../images

    I have another problem with sorting the data. I have a page with two dataobject_manager objects. Each of them has a sortable property.
    Sorting the data works now in the first tab on list & grid-view, on the second tab, i can only sort the data in grid view, not in list view. I can change the order of the tabs and i have the same effect with the second tab.
    Do you have any suggestion?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: DataObjectManager module Link to this post

    Thanks for uncovering this bug. I'll first confirm it and then issue a fix. At that point, revert your changes and checkout the latest version. I'll make a post when I have it figured out. Thanks.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: DataObjectManager module Link to this post

    Okay, I've confirmed it. This is very bizarre. For some reason, only that checkbox has the strange behavior of binding to the first DOM on the page. All the other event handlers are aware of their unique containers. So strange.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: DataObjectManager module Link to this post

    Yup. You'll see someone mentioned that a few posts ago. I'll be checking in a new version with the correct pathing soon.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Preview: DataObjectManager module Link to this post

    SOLVED!

    The checkbox had an ID tied to it to link it to its label. That id was not unique if more than on DOM was on a page, so the target of the click event was always the first DOM on the page. Made the id on the input unique, and it seems to be working now.

    Those of you who messed with the pathing in the CSS/JS, please revert and check out the new version from SVN. Thanks.

    60167 Views
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.