micschk / silverstripe-groupable-gridfield
此模块允许在 GridField 中通过拖放进行项目分组
1.0
2020-07-18 09:03 UTC
Requires
Requires (Dev)
Suggests
- micschk/silverstripe-block_enhancements: Enhancements to the Silverstripe Blocks module
README
此模块允许在 GridField 中通过拖放进行项目分组。它依赖于 GridFieldOrderableRows 来实现拖放排序功能
屏幕截图
示例应用(块增强模块):通过拖放将内容块分配到块区域
安装
Composer
composer require micschk/silverstripe-groupable-gridfield
需求(所有需求均由 composer 引入)
- SilverStripe 框架 ~4.0
- SilverStripe GridFieldExtensions
用法
$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', ) ));
感谢
TITLE WEB SOLUTIONS 赞助将此模块从 Blocks Enhancements 中独立出来