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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

2.4 Many_Many Sort Order + Drag and Drop


Go to End


2 Posts   702 Views

Avatar
lozhowlett

Community Member, 151 Posts

21 June 2013 at 1:47am

Hi All

We have a site on 2.4 and the client requires the ability to sort order products within categories using drag and drop.

Products....

//Relate to the category pages
	static $belongs_many_many = array(
		'Categories' => 'CategoryPage'
	);

Category....

static $many_many = array(
        'Products' => 'Product'
    );

I cant think of a way to add in drag and drop sort order on this, fine with one-to-many, but not sure there is a way to do this in 2.4?

Any help would be great, thanks.

Avatar
Devlin

Community Member, 344 Posts

21 June 2013 at 2:10am

I think Uncle Cheese's ManyManyDataObjectManager has a dynamic sort method with a drag and drop feature. Dunno how well it works, but maybe you give it try.