2012-05-09 19:13:49 +02:00
|
|
|
SortableGridField
|
|
|
|
=================
|
|
|
|
|
2012-05-09 19:31:28 +02:00
|
|
|
Adds drag and drop functionality to SilverStripe 3.0's GridField
|
|
|
|
|
|
|
|
## Usage
|
2012-05-10 16:27:01 +02:00
|
|
|
To enable sorting on a has_many relationship set up an interger field on your data object.
|
2012-05-09 19:31:28 +02:00
|
|
|
|
2012-05-10 16:27:01 +02:00
|
|
|
To enable drag and drop sorting on the grid field add the following to your grid field's config
|
2012-05-09 19:31:28 +02:00
|
|
|
*Grid Field Config*
|
2012-05-09 19:39:14 +02:00
|
|
|
|
|
|
|
:::php
|
2012-05-17 03:41:14 +02:00
|
|
|
$myGridConfig->addComponent(new GridFieldSortableRows('{Column to store sort}'));
|
|
|
|
|
|
|
|
To move an item to another page drag the row over the respective page button and release.
|
|
|
|
|
|
|
|
## @TODO
|
|
|
|
* Optimize re-ordering of a has_many relationship when sorting on a single page
|
|
|
|
* Add visual cue that a row can be dropped over the page icons
|