Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ENHANCEMENT SSF-53 reordering the components that added to group Grid…

…Field in CMS so that it appears same as the landing view of SecurityAdmin
  • Loading branch information...
commit 5548c66a49d65137a921a7038c2d9e10da0faa05 1 parent de75798
@normann normann authored
Showing with 8 additions and 3 deletions.
  1. +1 −1  forms/gridfield/GridFieldConfig.php
  2. +7 −2 security/Group.php
View
2  forms/gridfield/GridFieldConfig.php
@@ -134,9 +134,9 @@ public static function create($fieldToSearch, $itemsPerPage=15){
* @param int $itemsPerPage - How many items per page should show up
*/
public function __construct($fieldToSearch, $itemsPerPage=15) {
- $this->addComponent(new GridFieldFilter());
$this->addComponent(new GridFieldRelationAdd($fieldToSearch));
$this->addComponent(new GridFieldSortableHeader());
+ $this->addComponent(new GridFieldFilter());
$this->addComponent(new GridFieldDefaultColumns());
$this->addComponent(new GridFieldAction_Edit());
$this->addComponent(new GridFieldRelationDelete());
View
9 security/Group.php
@@ -61,8 +61,13 @@ function getAllChildren() {
public function getCMSFields() {
Requirements::javascript(SAPPHIRE_DIR . '/javascript/PermissionCheckboxSetField.js');
- $config = new GridFieldConfig_ManyManyEditor('FirstName', 20);
- $config->addComponents(new GridFieldExporter(), new GridFieldTitle());
+ $config = new GridFieldConfig();
+ $config->addComponent(new GridFieldTitle());
+ $configs = new GridFieldConfig_ManyManyEditor('FirstName', 20);
+ $components = $configs->getComponents();
+ foreach($components as $component) $config->addComponent($component);
+ $config->addComponents(new GridFieldExporter());
+
$config->getComponentByType('GridFieldRelationAdd')
->setResultsFormat('$Title ($Email)')->setSearchFields(array('FirstName', 'Surname', 'Email'));
$memberList = new GridField('Members','Members', $this->Members(), $config);
Please sign in to comment.
Something went wrong with that request. Please try again.