mirror of
https://github.com/UndefinedOffset/SortableGridField.git
synced 2024-09-29 11:18:58 +02:00
b0fcb318ad
Implemented a better sorting algorithm for sorting cross pages Removed sorting to first page and last page as this would mean re-indexing allot of items potentially
19 lines
599 B
Markdown
19 lines
599 B
Markdown
SortableGridField
|
|
=================
|
|
|
|
Adds drag and drop functionality to SilverStripe 3.0's GridField
|
|
|
|
## Usage
|
|
To enable sorting on a has_many relationship set up an interger field on your data object.
|
|
|
|
To enable drag and drop sorting on the grid field add the following to your grid field's config
|
|
*Grid Field Config*
|
|
|
|
:::php
|
|
$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
|