restruct/silverstripe-groupable-gridfield
最新稳定版本:3.0.0
Composer 安装命令:
composer require restruct/silverstripe-groupable-gridfield
包简介
This module allows drag & drop grouping of items in a GridField
README 文档
README
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).
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
- TITLE WEB SOLUTIONS for sponsoring the initial development of this module
统计信息
- 总下载量: 33
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-24