Skip to content

SilverStripe module providing drag & drop grouping of items in a GridField

License

Notifications You must be signed in to change notification settings

micschk/silverstripe-groupable-gridfield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SilverStripe GridField Groupable

Build Status codecov.io

This module allows drag & drop grouping of items in a GridField. It bolts on top of- and depends on GridFieldOrderableRows for the drag & drop sorting functionality

Screenshot

image

Example application (Block Enhancements module): assign content blocks to block-areas by drag & drop

Installation

Composer

composer require micschk/silverstripe-groupable-gridfield

Requirements (all pulled in by composer)

  • SilverStripe Framework ~4.0
  • SilverStripe GridFieldExtensions

Usage:

$grid = new GridField(
    'ExampleGrid',
    'Example Grid',
    $this->Items(),
    $gfConfig = GridFieldConfig::create()
        ->addComponent(new GridFieldToolbarHeader())
        ->addComponent(new GridFieldTitleHeader())
        ->addComponent(new GridFieldEditableColumns())
        ->addComponent(new GridFieldOrderableRows())
        ->addComponent(new GridFieldFooter())
);
// add Groupable (example from BlockEnhancements module)
$gfConfig->addComponent(new GridFieldGroupable(
        'BlockArea',    // The fieldname to set the Group
        'Area',   // A description of the function of the group
        'none',         // A title/header for items without a group/unassigned
        array(          // List of available values for the Group field
            'BeforeContent' => 'Before Content',
            'AfterContent' => 'Before Content',
        )
    ));

Thank you

TITLE WEB SOLUTIONS for sponsoring the isolation of this module out of Blocks Enhancements

About

SilverStripe module providing drag & drop grouping of items in a GridField

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •