Skip to content

Missing something? #18

Open
Open
@ghost

Description

Hi everyone,

Just trying to use this addon, but actually isn't working on my SilverStripe 3 project. Here the case:

mysite/code/DuplicaEvento.php

<?php

  /**
  * Classe Duplica
  */
  class DuplicaEvento extends ModelAdmin {
	// Dichiarazione Proprietà
	private static $managed_models = array(
        'EventoCorrelato' // <- This is my DataObject related to the destination Grid
	);

    /**
    * Override funzione Form
    **/
    function getEditForm($id = null, $fields = null) {
	  $form = parent::getEditForm($id, $fields);
	  $nomeGriglia = 'EventiCorrelati'; // Trying to filter a specified Grid
	  $griglia = $form->Fields()->fieldByName($nomeGriglia);

	  if ($griglia) {
		$griglia->getConfig()->addComponent(new GridFieldCopyButton());
	  }

	  return $form;
    }
  }

I tried the main example too, with no results. My doubt is related to the fact that EventiCorrelati is a grid extended and implemented in pair with another extension (to be more specific I'm using sortablegridfield). In the first place I thought that can should be the cause. But, by trying with typical situation as standard GridFields - without any addon - the button still not appear.

Any ideas?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions