Skip to content
Newer
Older
100644 34 lines (23 sloc) 2.03 KB
0638c2d @UndefinedOffset initial commit
authored May 9, 2012
1 SortableGridField
2 =================
3
a561953 @UndefinedOffset Update README.md
authored May 9, 2012
4 Adds drag and drop functionality to SilverStripe 3.0's GridField
5
f9664b5 @UndefinedOffset Update master
authored Jun 18, 2012
6 ## Requirments
0b0658e @UndefinedOffset Fixed typo and updated required version
authored Jun 29, 2012
7 * SilverStripe 3.0
f9664b5 @UndefinedOffset Update master
authored Jun 18, 2012
8
74708a3 @UndefinedOffset Added install instructions
authored Jun 26, 2012
9 ## Installation
10 * Download the module from here https://github.com/UndefinedOffset/SortableGridField/downloads
11 * Extract the downloaded archive into your site root so that the destination folder is called SortableGridField, opening the extracted folder should contain _config.php in the root along with other files/folders
0b0658e @UndefinedOffset Fixed typo and updated required version
authored Jun 29, 2012
12 * Run dev/build?flush=all to regenerate the manifest
74708a3 @UndefinedOffset Added install instructions
authored Jun 26, 2012
13 * Upon entering the cms and using GridFieldSortableRows component for the first time you make need to add ?flush=all to the end of the address to force the templates to regenerate
14
a561953 @UndefinedOffset Update README.md
authored May 9, 2012
15 ## Usage
67b9061 @UndefinedOffset Update README.md
authored Aug 20, 2012
16 To enable sorting on a has_many relationship set up an interger field on your data object. Also for has_many relationships make sure to set the $default_sort on the dataobject to this new interger field to ensure that the sort order is applied when the relationship is requested. For many_many relationships you must add a $many_many_extraFields static to the data object defining the relationship, see the SilverStripe documentation for more information on this. If you are using a many_many relationship you will need to do a custom getter to set the sort order of this relationship for use on the front end see bellow for an example. For new DataObjects you do not need to increment the Sort order yourself in your DataObject GridFieldSortableRows will automatically do this the next time the grid is displayed.
29e5209 @UndefinedOffset Corrected example snippet not displaying right
authored Jul 10, 2012
17
2dc1fb8 @UndefinedOffset Added example for many_many relationships
authored Jul 10, 2012
18 :::php
19 public function getMyManyManyRelationship() {
20 return $this->getManyManyComponents('MyManyManyRelationship')->sort('SortColumn');
21 }
22
a561953 @UndefinedOffset Update README.md
authored May 9, 2012
23
3b19642 @UndefinedOffset Removed GridFieldSortableObject this is now handled by the developer …
authored May 10, 2012
24 To enable drag and drop sorting on the grid field add the following to your grid field's config
a561953 @UndefinedOffset Update README.md
authored May 9, 2012
25 *Grid Field Config*
d075e85 @UndefinedOffset Fixed document
authored May 9, 2012
26
27 :::php
a07118e @UndefinedOffset Update README.md
authored May 16, 2012
28 $myGridConfig->addComponent(new GridFieldSortableRows('{Column to store sort}'));
29
30 To move an item to another page drag the row over the respective page button and release.
31
32 ## @TODO
33 * Optimize re-ordering of a has_many relationship when sorting on a single page
Something went wrong with that request. Please try again.