Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Display order - solved


Go to End


907 Views

Avatar
digibrains

Community Member, 130 Posts

24 September 2010 at 8:11am

Edited: 24/09/2010 10:14am


ss - 2.4.0
dom - r414

In my dataobject controller I am using:
static $default_sort = "BannerWeight ASC";

"BannerWeight" is an INT field to weight the sort-order of the data return.

When I enable and use DOM the data is returned in last-in-first-out order, but when I use the default ManyManyComplexTableField the data is returned correctly i.e., in the $default_sort order specified.

This isn't a huge deal, but for consistency sake, I'd like to keep all my data objects controlled by DOM.

Any thoughts? Remove the BannerWeight field and use drag-and-drop sorting?

Edit: I just realized that the DOM adds a sort field that it sorts by. My bad.
I do wonder how you override that. It would be nice to use both, DOM and be able to custom sort.

Edit 2: Just don't add it to the add_sortable_classes in _config.php. Duh!

Chris.b