micschk/silverstripe-groupable-gridfield

This package is abandoned and no longer maintained. The author suggests using the restruct/silverstripe-groupable-gridfield package instead.

This module allows drag & drop grouping of items in a GridField

Installs: 12 701

Dependents: 3

Suggesters: 0

Security: 0

Stars: 7

Watchers: 3

Forks: 9

Open Issues: 1

Type:silverstripe-vendormodule

pkg:composer/micschk/silverstripe-groupable-gridfield

1.0.2 2025-06-24 12:01 UTC

This package is auto-updated.

Last update: 2025-09-24 09:45:34 UTC


README

Build Status codecov.io

This module facilitates drag & drop grouping of items in a GridField.
It bolts on top of- and depends on GridFieldOrderableRows for the drag & drop sorting functionality.
Allows adding new 'groups' on the fly when configured with a MultiValueField to store them.
Groups themselves can also be reordered (drag-drop, experimental).

groupable

NOTE: currently slightly 'WIP'

We found a (Silverstripe 3) project in which quite a lot of development was done on this module which never got published (a.o. group reordering). These updates + additions have now been included + updated in this module but may still need a bit of work/debugging.

  • Updated namespace micsck\GroupableGridfield -> Restruct\Silverstripe\GroupableGridfield

Usage:

$gfConfig = GridFieldConfig::create()
    // setup your config as usual, must include orderable rows
    ->addComponent(new GridFieldOrderableRows())
    // add Groupable + AddNewGroupButton
    ->addComponent(new GridFieldAddNewGroupButton('buttons-before-right'))
    ->addComponent(new GridFieldGroupable(
        'Phase', // field on subjects to hold group key
        $this->fieldLabel('Phase'), // label of group field
        'none', // fallback/unassigned group name
        null, // (fixed) list of available groups (key value), set to null to use MultiValue field instead
        'Phases' // name of MultiValueField on source record to provide groups (allows adding new on-the-fly)
    ));

Thanks