Adds type/class picking functionality to SilverStripe 4's GridField


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

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

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

Authors: Ed Chipman

6 1 5.1K


Readme

GridFieldItemType

Adds type/class picking functionality to SilverStripe 4's GridField.

Maintainer Contact

Requirements

  • SilverStripe 4.1+

Installation

  • Download the module from here https://github.com/webbuilders-group/silverstripe-gridfielditemtype/archive/master.zip
  • Extract the downloaded archive into your site root so that the destination folder is called GridFieldItemType, opening the extracted folder should contain _config.php in the root along with other files/folders
  • Run dev/build?flush=all to regenerate the manifest
  • Upon entering the cms and using GridFieldItemType components for the first time you make need to add ?flush=all to the end of the address to force the templates to regenerate

Usage

If you are working with one of the pre-configured GridFieldConfigs you must first remove the default GridFieldDetailForm and GridFieldAddNewButton components replacing them with ItemTypeDetailForm and AddNewItemTypeButton respectively

use WebbuildersGroup\GridField\ItemType\AddNewItemTypeButton;
use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor;

$config=GridFieldConfig_RecordEditor::create(10);
$config->removeComponentsByType('GridFieldAddNewButton');
$config->removeComponentsByType('GridFieldDetailForm');
$config->addComponent(new AddNewItemTypeButton($yourOptionsMap, 'buttons-before-left', 'empty string', 'default'));
$config->addComponent(new ItemTypeDetailForm());

If you are using the base GridField config you need to add both the AddNewItemTypeButton and ItemTypeDetailForm to your config

use WebbuildersGroup\GridField\ItemType\AddNewItemTypeButton;
use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor;

$config=GridFieldConfig_Base::create(10);
$config->addComponent(new AddNewItemTypeButton($yourOptionsMap, 'buttons-before-left'));
$config->addComponent(new ItemTypeDetailForm());

If you are managing a versioned object you must override the item request class using:

use WebbuildersGroup\GridField\ItemType\VersionedItemTypeDetailForm_ItemRequest;

$detailForm->setItemRequestClass(VersionedItemTypeDetailForm_ItemRequest::class);

Note: All options in the type dropdown must be decendents of the model class.


Versions

dev-master
2020-5-14 2458894: UTC
BSD-3-Clause

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

Manual Install: Download

Requires
  • silverstripe/framework: ~4.1
  • php: >=7.1.0
2.0.x-dev
2019-34-29 2458513: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-gridfielditemtype 2.0.x-dev

Manual Install: Download

Requires
  • silverstripe/framework: ~4.1
1.0.x-dev
2018-55-25 2458264: UTC
BSD-3-Clause

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

Manual Install: Download

Requires
  • silverstripe/framework: ~3.1
  • composer/installers: *
3.0.x-dev
2013-19-17 2456644: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-gridfielditemtype 3.0.x-dev

Manual Install: Download

Requires
  • silverstripe/framework: 3.0.*
  • composer/installers: *
2.1.1
2020-5-14 2458894: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-gridfielditemtype 2.1.1

Manual Install: Download

Requires
  • php: >=7.1.0
  • silverstripe/framework: ~4.1
2.1.0
2020-33-13 2458893: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-gridfielditemtype 2.1.0

Manual Install: Download

Requires
  • php: >=7.1.0
  • silverstripe/framework: ~4.1
2.0.0
2019-34-29 2458513: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-gridfielditemtype 2.0.0

Manual Install: Download

Requires
  • silverstripe/framework: ~4.1
1.0.0
2018-55-25 2458264: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-gridfielditemtype 1.0.0

Manual Install: Download

Requires
  • silverstripe/framework: ~3.1
  • composer/installers: *
0.4.0
2017-29-12 2457886: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-gridfielditemtype 0.4.0

Manual Install: Download

Requires
  • silverstripe/framework: ~3.1
  • composer/installers: *
0.3.0
2016-27-3 2457422: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-gridfielditemtype 0.3.0

Manual Install: Download

Requires
  • silverstripe/framework: 3.1.*
  • composer/installers: *
0.2.1
2014-11-15 2456763: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-gridfielditemtype 0.2.1

Manual Install: Download

Requires
  • silverstripe/framework: 3.1.*
  • composer/installers: *
0.1.3
2013-16-30 2456596: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-gridfielditemtype 0.1.3

Manual Install: Download

Requires
  • silverstripe/framework: 3.0.*
  • composer/installers: *
0.2.0
2013-14-30 2456596: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-gridfielditemtype 0.2.0

Manual Install: Download

Requires
  • silverstripe/framework: 3.1.*
  • composer/installers: *
0.1.2
2013-8-9 2456545: UTC
BSD-3-Clause

Install composer require webbuilders-group/silverstripe-gridfielditemtype 0.1.2

Manual Install: Download

Requires
  • silverstripe/framework: 3.*
  • composer/installers: *
0.1.1
2013-5-22 2456527: UTC
Unknown

Install composer require webbuilders-group/silverstripe-gridfielditemtype 0.1.1

Manual Install: Download

Requires
  • silverstripe/framework: 3.*
  • composer/installers: *
0.1.0
2013-2-26 2456500: UTC
Unknown

Install composer require webbuilders-group/silverstripe-gridfielditemtype 0.1.0

Manual Install: Download

Requires
  • silverstripe/framework: 3.*
  • composer/installers: *