title: Two dataobject managed in one gridfied with orderable columns. Silverstripe 3.1
body: <p>I'm working with Silverstripe 3.1</p>
  
  <p>I would like manage in one admin model page two dataobject. Here is my first DataObject :</p>
  
  <pre><code>class Interview extends DataObject
  {
      private static $db = array(
          'Name'          =&gt; 'Varchar(255)',
          'LieuExercice'  =&gt; 'Varchar(255)',
          'Presentation'  =&gt; 'Text',
      );
  
      private static $has_one = array(
          'Photo'     =&gt; 'Image'
      );
  
      private static $belongs_many_many = array(
          'Journal'   =&gt; 'Journal'
      );
  
      // Change the label in datagrid
      private static $field_labels = array(
          'NameAndExercice' =&gt; 'Nom de la personne interviewée',
          'LieuExercice' =&gt; 'Lieu d\'exercice'
      );
      public function getNameAndExercice(){
          return  new LiteralField('NameAndExercice', $this-&gt;Name  . ' &lt;em style=\'font-size:11px\'&gt;('.$this-&gt;LieuExercice.')&lt;/em&gt;');
      }
  
      private static $summary_fields = array(
          'NameAndExercice',
      );
  
      public function getCMSFields() {
          $fields = FieldList::create(TabSet::create('Root'));
          $fields-&gt;addFieldsToTab('Root.Contenu', TextField::create('Name', 'Nom de la personne interviewée'));
          $fields-&gt;addFieldsToTab('Root.Contenu', TextField::create('LieuExercice', 'Lieu d\'exercice')-&gt;setDescription('Lieu d\'exercice de la personne'));
          $fields-&gt;addFieldsToTab('Root.Contenu', TextareaField::create('Presentation', 'Présentation')-&gt;setDescription('Courte présentation de la personne'));
          $fields-&gt;addFieldsToTab('Root.Contenu', $photo = UploadField::create('Photo', 'Portrait de la personne interviewée')-&gt;setDescription('Fichier image du portrait de la personne'));
  
          //Fields configuration
          $photo-&gt;getValidator()-&gt;setAllowedExtensions(array('png', 'jpg', 'gif', 'jpeg'));
          $photo-&gt;setFolderName('interview-photos');
  
          return $fields;
      }
  }
  </code></pre>
  
  <p>And here is my 2nd DataObject :</p>
  
  <pre><code>class Article extends DataObject
  {
      private static $db = array(
          'Title'          =&gt; 'Varchar(255)',
  
      );
  
      private static $has_one = array(
          'Photo'     =&gt; 'Image'
      );
  
      private static $belongs_many_many = array(
          'Journal'   =&gt; 'Journal'
      );
  
      public function getCMSFields() {
          $fields = FieldList::create(TabSet::create('Root'));
  
          $fields-&gt;addFieldsToTab('Root.Contenu', TextField::create('Title', 'Titre de l\'article'));
  
          $fields-&gt;addFieldsToTab('Root.Contenu', $photo = UploadField::create('Photo', 'Portrait de la personne interviewée')-&gt;setDescription('Fichier image du portrait de la personne'));
  
          //Fields configuration
          $photo-&gt;getValidator()-&gt;setAllowedExtensions(array('png', 'jpg', 'gif', 'jpeg'));
          $photo-&gt;setFolderName('interview-photos');
  
          return $fields;
      }
  }
  </code></pre>
  
  <p>Finally, I have a 'parent' dataObject witch contain some Interviews and Article :</p>
  
  <pre><code>class Journal extends DataObject
  {
      private static $db = array(
          'Title' =&gt; 'Varchar',
          'DatePublication'   =&gt; 'Date'
      );
      private static $has_one = array(
          'Couverture'        =&gt; 'Image'
      );
      private static $many_many = array(
          'Interviews'    =&gt; 'Interview',
          'Articles'      =&gt; 'Article',
      );
      private static $many_many_extraFields = array(
          'Interviews' =&gt; array(
              'SorterField' =&gt; 'Int',
          ),
          'Articles' =&gt; array(
              'SorterField' =&gt; 'Int',
          ),
      );
  
      public function getCMSFields(){
              $fields = FieldList::create(TabSet::create('Root'));
  
              $fields-&gt;addFieldsToTab('Root.Main', array(
                  $titleField = TextField::create('Title', 'Titre / Numéro du journal'),
                  $datePublicationField = DateField::create('DatePublication', 'Date de publication'),
                  $uploadField = UploadField::create('Couverture', 'Couverture du journal')
  
              ));
  
  
              if($this-&gt;ID){
                  $fields-&gt;insertAfter(
                      new Tab('Content', 'Contenu du journal'),
                      'Main'
                  );
  
                  //$buttonCreateMultiClass = new GridFieldAddNewMultiClass();
                  //$buttonCreateMultiClass-&gt;setClasses(array('Interviews', 'Article'));
  
                  $config = GridFieldConfig_RelationEditor::create();
                  $config-&gt;addComponent(new GridFieldOrderableRows('SorterField'));
  
                  $fields-&gt;addFieldsToTab('Root.Content', GridField::create(
                      'Interviewsz',
                      'Contenu de ce journal',
                      $this-&gt;getManyManyComponents('Interviews')-&gt;sort('SorterField'),
                      $config
                  ));
              }
  
              // Fields configuration
              $datePublicationField-&gt;setConfig ('showcalendar', true);
              $uploadField-&gt;getValidator()-&gt;setAllowedExtensions(array('jpg', 'gif', 'png', 'jpeg'));
              $uploadField-&gt;setFolderName('journals-couvertures');
              return $fields;
  
      }
  }
  </code></pre>
  
  <p>I would like in a model admin page of Journal:
  - Create new Journal : OK, done
  - Link one or more interview to this Journal
  - Link one or more article to this Journal
  - Manage the order of article and interview inside the journal</p>
  
  <p>How do this ?</p>
  
  <p>Thanks for your help.</p>