micschk/silverstripe-groupable-gridfield

此模块允许在 GridField 中通过拖放进行项目分组

安装次数: 12,562

依赖关系: 3

建议者: 0

安全性: 0

星标: 7

关注者: 3

分支: 8

开放问题: 1

类型:silverstripe-vendormodule

1.0 2020-07-18 09:03 UTC

This package is auto-updated.

Last update: 2024-09-18 18:31:07 UTC


README

Build Status codecov.io

此模块允许在 GridField 中通过拖放进行项目分组。它依赖于 GridFieldOrderableRows 来实现拖放排序功能

屏幕截图

image

示例应用(块增强模块):通过拖放将内容块分配到块区域

安装

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 中独立出来