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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

SortableGridField - not showing sorted data


Go to End


2 Posts   1226 Views

Avatar
ismooth

Community Member, 25 Posts

12 September 2014 at 3:31am

Hi,

I'm using SortableGridField with SS 3.1.6, and noticed that on a many_many relation which has many_many_extrafield 'SortOrder' which I'm showing in CMS, records aren't shown in sort order. It is used in getCMSFields() like this:

function getCMSFields() {
  $fields = parent::getCMSFields();
	$keywen = $f->datafieldByName('Keywords_en');
	$keywen->getConfig()->addComponent(new GridFieldSortableRows('SortOrder'));
  return $fields;
}

Sort order is properly saved in the database, but data isn't sorted by it anymore when showing in CMS. Before it used to show properly. Attached pictures show that when enable drag and drop option isn't checked data isn't sorted by SortOrder column, but by ID. How can I achieve sorting by SortOrder when 'enable drag and drop' option isn't checked? Is this some issue with new update of SS?

Avatar
ismooth

Community Member, 25 Posts

3 October 2014 at 2:53am

Anyone? :(