Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Minor issues w/ DOM Sorting, Saving, & Results per Page

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: 1023 Views
  • socks
    Avatar
    Community Member
    190 Posts

    Minor issues w/ DOM Sorting, Saving, & Results per Page Link to this post

    I'm just now getting to play around with the DataObjectManager module. Thank you Uncle Cheese for all your hard work.

    In the Admin:

    Initial Sorting
    When I add new objects and hit Save, the list / table shows the most recent entries on top (which is good). But if I go to another page in Site Tree and come back to edit, the newest entries are no longer on top. If I select a different Results Per Page from the dropdown, the table re-sorts and puts the newest on top. Anyway to make it stay that way when I initially go to that page to view or add more objects?

    Saving
    It doesn't seem necessary to Save or Save & Publish the page if I just Add more objects since the objects are being saved via the button in the pop-up window. But I get the "Are you sure you want to navigate away from this page without saving" warning if I don't Save or Save & Publish the page. Is this a bug?

    Show - Results Per Page
    Is there any way to make the admin remember whatever I selected last (ie show 30 results per page). I have to change it every time I come back to the page. Or could I set the default somehow in the code.

    thanks

  • UncleCheese
    Avatar
    4085 Posts

    Re: Minor issues w/ DOM Sorting, Saving, & Results per Page Link to this post

    Wow. Great catches. Thanks for this.

    I have fixed the bug that was causing DOM to only order by Created DESC only on DOM reloads. Should order by Created DESC all the time now by default, that is, unless you override $SourceSort in the constructor.

    I have also added a few more handy functions

          $myDOM->setPerPageMap(array(
           '100','200','300'
          ));
          $myDOL->setUseViewAll(false);

    If you have a large number of records, you may want values other than 10,20,30,40,50. You can now use setPerPageMap() to customize. As always, you can use setPageSize() to set a default value. Also, the setUseViewAll(() boolean will add or remove the "All" value of the per-page dropdown.

    The alert message that happens when navigating away from a DOM page has existed for a while. I wish to god I could figure it out. I'm looking for answers!

    1023 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.