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


Repository: https://github.com/webbuilders-group/silverstripe-limitedrelationsgridfield

Packagist: http://packagist.org/packages/webbuilders-group/silverstripe-limitedrelationsgridfield

Issues: https://github.com/webbuilders-group/silverstripe-limitedrelationsgridfield/issues

Authors: Ed Chipman

4 4 1.3K


Readme

Limited Relations GridField

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

Maintainer Contact

Requirements

  • SilverStripe CMS 4.2+

Installation

Composer (recommended):

composer require webbuilders-group/silverstripe-limitedrelationsgridfield

Usage

For many_many relationships simply swap the configuration for the GridField with LRGridFieldConfig_RelationEditor, for example.

//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.

//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.

$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.

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

Versions

dev-master
2019-39-6 2458549: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-limitedrelationsgridfield dev-master

Manual Install: Download

Requires
  • silverstripe/framework: ~4.2
  • composer/installers: *
1.0.x-dev
2017-26-1 2457814: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-limitedrelationsgridfield 1.0.x-dev

Manual Install: Download

Requires
  • silverstripe/framework: ~3.1
  • composer/installers: *
2.0.2
2023-48-26 2460152: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-limitedrelationsgridfield 2.0.2

Manual Install: Download

Requires
  • silverstripe/framework: ~4.2|~5.0
  • composer/installers: *
2.0.1
2021-21-6 2459311: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-limitedrelationsgridfield 2.0.1

Manual Install: Download

Requires
  • silverstripe/framework: ~4.2
  • composer/installers: *
2.0.0
2019-39-6 2458549: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-limitedrelationsgridfield 2.0.0

Manual Install: Download

Requires
  • silverstripe/framework: ~4.2
  • composer/installers: *
0.1.1
2017-26-1 2457814: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-limitedrelationsgridfield 0.1.1

Manual Install: Download

Requires
  • silverstripe/framework: ~3.1
  • composer/installers: *
1.0.0
2017-26-1 2457814: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-limitedrelationsgridfield 1.0.0

Manual Install: Download

Requires
  • silverstripe/framework: ~3.1
  • composer/installers: *
0.1.0
2017-7-1 2457814: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-limitedrelationsgridfield 0.1.0

Manual Install: Download

Requires
  • silverstripe/framework: ~3.1
  • composer/installers: *