7912 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Drag & Drop on resouce page
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 784 Views |
-
Drag & Drop on resouce page

27 July 2009 at 4:03pm
Does anyone have any hints on activating the drag and drop reordering as seen in the AssetManager?
In the example code of ResourcePage is it possible to activate it in the 'new FileDataObjectManager'. I thought it would be possible with $manager->showAll = true; or $manager->sortable();I managed to get it going in a sense by adding
"SortOrder" => "Int"
to db array, and
static $default_sort = "SortOrder";
in Resource.phpthen
$manager->showAll = true;
in ResourcePage.phpI'm not sure if there's an easier way or if there's anything wrong with the current method...
-
Re: Drag & Drop on resouce page

28 July 2009 at 3:45am
You need to add in your _config.php:
SortableDataObject::add_sortable_class('MyDataObject');
That will decorate in the field for you and handle the sort controller for that object. This is explained in the documentation.
-
Re: Drag & Drop on resouce page

28 July 2009 at 9:03am
.........I saw that in the documentation, but was hellishly confused at how assetmanager was achieving it without being in the config. Thank you Mr Uncle Cheese, it works a beaut
-
Re: Drag & Drop on resouce page

28 July 2009 at 10:06am Last edited: 28 July 2009 10:08am
The DOM will automatically add file as a sortable class if you have override_asset_admin set to true.
| 784 Views | ||
|
Page:
1
|
Go to Top |

