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.

General Questions /

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

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

2.4 Many_Many Sort Order + Drag and Drop


Reply


2 Posts   346 Views

Avatar
lozhowlett

Community Member, 146 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, 225 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.