Fixed document

This commit is contained in:
Ed 2012-05-09 14:39:14 -03:00
parent a561953c66
commit d075e856bc

View File

@ -4,17 +4,22 @@ SortableGridField
Adds drag and drop functionality to SilverStripe 3.0's GridField Adds drag and drop functionality to SilverStripe 3.0's GridField
## Usage ## Usage
To enable sorting on a data object add one of the following you your sites _config.php
*mysite/_config.php* *mysite/_config.php*
:::php :::php
GridFieldSortableObject::add_sortable_class('{ClassName}'); //For has_many relationships GridFieldSortableObject::add_sortable_class('{ClassName}'); //For has_many relationships
GridFieldSortableObject::add_sortable_many_many_relation('{Owner ClassName}', '{Component Name}'); //For many_many relationships GridFieldSortableObject::add_sortable_many_many_relation('{Owner ClassName}', '{Component Name}'); //For many_many relationships
To enable sorting on the grid field add the following to your grid field's config
*Grid Field Config* *Grid Field Config*
:::php
$myGridConfig->addComponent(new GridFieldSortableRows()); :::php
$myGridConfig->addComponent(new GridFieldSortableRows());
## Known Isuses ## Known Isuses
* Many_many relationship is largely untested and may not work as expected * Many_many relationship is largely untested and may not work as expected
* Documentation on GridFieldSortableObject is very poor * Documentation on GridFieldSortableObject is very poor