Nice redevelopment, UncleCheese! Especially for documenting your work on the wiki (http://doc.silverstripe.com/doku.php?id=modules:sortabledataobject). Some PHPDoc documentation would be nice as well ;)
Quote from UncleCheese (from a previous thread):
I still think that HTML-tags shouldn't be in model-classes like SortableDataObject - for one, because the HTML-representation doesn't have anything to do with the data structure (you can usually configure the drag/drop-libs to work on different tags). You can expect users to act on a Iterator in their templates, and include the Requirements themselves (which means you don't need to get it in "through the backdoor" in SortableDataObjectSet->beginSortable(). Its a tradeoff between ease-of-use on one side, and architectural structure and flexibility on the other side.
Thanks for your feedback, Ingo. I'll get to the PHPDoc once I figure out how the heck to do it. :-)
I agree, drawing markup in a DataModel is never pretty, and I always have to swallow hard when I do it, but I guess I think about it like a form field helper, for instance.
I'm open to suggestions, as I'd love to see my work implemented. Do you have any ideas that would help it follow best practices more closely yet still provide gains in production time to the developer?
My question is looking to extend the SortableDataObject - I am looking to develop an ajax drag n drop cart functionality with the existing e-commerce Module
I have been playing with the script.aculo.us drag n drop code as seen at
http://demo.script.aculo.us/ & at http://design.theguigirl.com/cart.php (an entertaining cart :) and was looking to see if any extension of what you have developed could be brought into the drag n drop cart
OR if anyone has tried implmenting an ajax drag n drop with Silverstripe?
Avoid scriptaculous at all costs and use jQuery. The prototype/scriptaculous framework is a behemoth and it's not all that easy to use. Silverstripe is in the process of migrating all their JS to jQuery, anyway. Save yourself a lot of trouble.
Also, SortableDataObject is obsolete since it has been merged into the DataObjectManager extension.