On 14/10/2015 5:26 AM, Neum Schmickrath wrote:
A few years ago I added several inline classes to Cartridge products. After upgrading to the latest Mezzanine and Cartridge versions I want to be able to use the drag and drop functionality in Orderable to be able to set the order of these inlines. Following the example in the Forms app I've set it to use the Orderable class and then created the database migration to add the _order field to the inline. The arrows now show up in the Admin interface and I can drag and drop them just like images and other inlines that use Orderable. But when I save the product it doesn't do anything. Looking into it further it's apparent that's because there are no numbers assigned in the database on the _order column. I'm sure this is because these products already exist so it's not assigning them order values on save.

I'm wondering what the best way would be to get the initial sort order on these inlines? I'm thinking of maybe a custom migration that loops through the products and sets the order? Any ideas what the best way to approach it would be?


I've added an 'order' field to Product in my fork of Cartridge, but never managed to get the drag-and-drop functionality to work, so I ended up just making the order field editable on the summary page as an integer.

Sorry I can't help more.

Seeya. Danny.

--
You received this message because you are subscribed to the Google Groups "Mezzanine 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to