2017 © Pedro Peláez
 

silverstripe-module multirecordfield

A module for editing multiple records on a backend or frontend form.

image

silbinarywolf/multirecordfield

A module for editing multiple records on a backend or frontend form.

  • Tuesday, May 29, 2018
  • by SilbinaryWolf
  • Repository
  • 1 Watchers
  • 1 Stars
  • 2,619 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 5 Open issues
  • 16 Versions
  • 11 % Grown

The README.md

Multi Record Field

A drop-in replacement for GridField. Allows creating and editing multiple records in a backend or frontend form., (*1)

Supports

  • SilverStripe 3.2 and up
  • PHP 5.4+
  • Display Logic
  • Dropzone Module
  • Quick Add New Module

Example Use

class Page extends SiteTree {
    private static $has_many = array(
        'Cells'      => 'BasicContent',
    );

    public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        $editor = MultiRecordField::create('ContentCellEditor', 'Content Cells', $this->Cells());
        $fields->addFieldToTab('Root.ContentCells', $editor);

        return $fields;
    }
}

MultiRecordField Nesting, (*2)

The MultiRecordField supports nesting of other MultiRecordFields. When the field detects a MultiRecordField in the set of fields to edit, that field is added as another nested toggle field inside the parent set of fields for editing., (*3)

**Transform existing GridField into MultiRecordField **, (*4)

You may want to retain a few configurations made to the GridField that MultiRecordField supports. In that case, you'll want to utilize the MultiRecordTransformation class., (*5)

This will ensure the properties on GridFieldExtensions GridFieldAddNewMultiClass will carry across., (*6)

<?php

foreach ($fields->dataFields() as $field) {
    if ($field instanceof GridField) {
        $fields->replaceField($field->getName(), $field->transform(new MultiRecordTransformation));
    }
}

Custom fields, (*7)

The MultiRecordField uses the output of getCMSFields when building the fieldlist used for editing. To provide an alternate set of fields, define a getMultiRecordFields method that returns a FieldList object., (*8)

Additionally, the MultiRecordField calls the updateMultiEditFields extension hook on the record being edited to allow extensions a chance to change the fields., (*9)

Screenshots

Alt text, (*10)

To-Do

Unit Tests Backend: - Ensure all form data is restored correctly when a Form $Validator returns false - Ensure Display Logic works cleanly with this module. - Ensure permission checking works as expected. Frontend: - Test sorting, ensure correct hidden fields are updated - Test add button and AJAX response. - Test error messages / display, (*11)

Maintainers

Bugtracker

The Versions

29/05 2018

dev-master

9999999-dev

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

The Requires

 

frontend silverstripe gridfield record editing

29/05 2018

2.1.4

2.1.4.0

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

The Requires

 

frontend silverstripe gridfield record editing

27/03 2017

2.1.3

2.1.3.0

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

The Requires

 

frontend silverstripe gridfield record editing

27/03 2017

dev-fix-32

dev-fix-32

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

The Requires

 

frontend silverstripe gridfield record editing

27/03 2017

2.1.2

2.1.2.0

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

The Requires

 

frontend silverstripe gridfield record editing

27/03 2017

2.1.1

2.1.1.0

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

The Requires

 

frontend silverstripe gridfield record editing

24/03 2017

2.1.0

2.1.0.0

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

The Requires

 

frontend silverstripe gridfield record editing

14/03 2017

2.0.3

2.0.3.0

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

frontend silverstripe gridfield record editing

06/03 2017

2.0.2

2.0.2.0

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

frontend silverstripe gridfield record editing

01/02 2017

2.0.1

2.0.1.0

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

frontend silverstripe gridfield record editing

01/02 2017

2.0.0

2.0.0.0

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

frontend silverstripe gridfield record editing

04/01 2017

1.0.4

1.0.4.0

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

frontend silverstripe gridfield record editing

04/12 2016

1.0.3

1.0.3.0

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

frontend silverstripe gridfield record editing

15/08 2016

1.0.2

1.0.2.0

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

frontend silverstripe gridfield record editing

15/08 2016

1.0.1

1.0.1.0

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

frontend silverstripe gridfield record editing

01/08 2016

1.0.0

1.0.0.0

A module for editing multiple records on a backend or frontend form.

  Sources   Download

BSD-3-Clause

frontend silverstripe gridfield record editing