mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
Add support for GridfieldOrderableRows
GridfieldExtensions' GridfieldOrderableRows is functionally quite similar (if not identical) to GridFieldSortableRows, and not all developers may want to support both modules. This commit adds fallback support for sorting Document Sets using GridfieldOrderableRows if it is installed, and GridFieldSortableRows is not. To test: 1. Uninstall GridFieldSortableRows (or start with an install without it) 2. Install GridFieldExtensions 3. Create/Open a Document Set 4. Make sure there are multiple files within. 5. Drag/drop reorder without errors
This commit is contained in:
parent
4f5dddc17d
commit
dfbddb49a2
@ -112,6 +112,8 @@ class DMSDocumentSet extends DataObject
|
||||
|
||||
if (class_exists('GridFieldSortableRows')) {
|
||||
$gridFieldConfig->addComponent(new GridFieldSortableRows('DocumentSort'));
|
||||
} elseif (class_exists('GridFieldOrderableRows')) {
|
||||
$gridFieldConfig->addComponent(new GridFieldOrderableRows('DocumentSort'));
|
||||
}
|
||||
|
||||
// Don't show which page this is if we're already editing within a page context
|
||||
|
Loading…
Reference in New Issue
Block a user