2017 © Pedro Peláez
 

silverstripe-module silverstripe-limitedrelationsgridfield

Adds the ability to limit the number of items in the relationship managed by GridField.

image

webbuilders-group/silverstripe-limitedrelationsgridfield

Adds the ability to limit the number of items in the relationship managed by GridField.

  • Wednesday, March 1, 2017
  • by WebbuildersGroup
  • Repository
  • 4 Watchers
  • 4 Stars
  • 145 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 3 Versions
  • 4 % Grown

The README.md

Limited Relations GridField

Adds the ability to limit the number of items in the relationship managed by GridField., (*1)

Maintainer Contact

Requirements

  • SilverStripe CMS 4.2+

Installation

Composer (recommended):, (*2)

composer require webbuilders-group/silverstripe-limitedrelationsgridfield

Usage

For many_many relationships simply swap the configuration for the GridField with LRGridFieldConfig_RelationEditor, for example., (*3)

//Create a GridField instance with a page length of 10 and a item cound limit of 20
new GridField('MyGridField', 'My GridField', $this->Relationship(), LRGridFieldConfig_RelationEditor::create(10, 20));

For has_many relationships simply swap the configuration for the GridField with LRGridFieldConfig_RecordEditor, for example., (*4)

//Create a GridField instance with a page length of 10 and a item cound limit of 20
new GridField('MyGridField', 'My GridField', $this->Relationship(), LRGridFieldConfig_RecordEditor::create(10, 20));

Configuration Options

The LRGridFieldAddExistingAutocompleter component provides a single method that allows changing of the limit, as well this limit can be set as the 3rd parameter to the constructor., (*5)

$myLimitedAutoCompleter->setItemLimit(3); //Change the item limit to 3

The LRGridFieldDetailForm component provides a single method that allows changing of the limit, as well this limit can be set as the 2nd parameter to the constructor., (*6)

$myLimitedDetailForm->setItemLimit(3); //Change the item limit to 3

The Versions

01/03 2017

dev-master

9999999-dev

Adds the ability to limit the number of items in the relationship managed by GridField.

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe gridfield relationship

01/03 2017

0.1.1

0.1.1.0

Adds the ability to limit the number of items in the relationship managed by GridField.

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe gridfield relationship

01/03 2017

0.1.0

0.1.0.0

Adds the ability to limit the number of items in the relationship managed by GridField.

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe gridfield relationship