定制 ucenna/silverstripe-sectioned-gridfield 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ucenna/silverstripe-sectioned-gridfield

Composer 安装命令:

composer require ucenna/silverstripe-sectioned-gridfield

包简介

Add sub grids to your gridfields.

README 文档

README

Requirements

Installation

composer require ucenna/silverstripe-sectioned-gridfield

Usage

Sectioned GridField extends the GridField class, albiet with added functionality to allow components to modify//expand grid rows. Configuration is more or less the same between the two.

$fields->addFieldToTab('Root.Regions', SectionedGridField::create(
 'Regions',
 'Region',
 $this->Regions(),
 new GridFieldConfig_ManyEditor('Items')
));

GridFieldConfig_ManyEditor

GridFieldConfig_ManyEditor is a GridFieldConfig that implements the GridFieldSubGrid component and takes a $has_many or many_many to parse into a child GridField. It can optionally be passed a GridFieldConfig that will be used to parse the child GridField like so: new GridFieldConfig_ManyEditor('Items', new GridFieldConfig_RecordEditor(). If no GridFieldConfig is specified, GridFieldConfig_Min will be used by default.

Example Image

GridFieldSubGrid

GridFieldSubGrid is a component that opens up a grid's childfield and spreads it out into it's own contained gridfield. It can be added to prebuilt GridFieldConfigs such as GridFieldConfig_Base and GridFieldConfig_RecordEditor or used to create a new GridFieldConfig.

$config->addComponent(new GridFieldSubGrid('Field to Expand'[, GridFieldConfig]));

GridFieldSubGrid takes the name of a field item to expand, and optionally a GridFieldConfig to expand that field item into. If no GridFieldConfig is specified, GridFieldConfig_Min will be used by default.

GridFieldConfig_Min

Is a mini GridFieldConfig designed to work well with GridFieldSubGrid. Alternate GridFieldConfigs can be used in it's place, but they may not be formatted as well.

Limitations

Currently, GridFieldSubGrid doesn't play nice with sorting and filter components such as GridFieldSortableHeader. Those components are still accessible and still work with GridFieldSubGrid, in fact GridFieldConfig_Min and GridFieldConfig_ManyEditor use them, but their sort and filter functions have been disabled. I may fix them later on if I can figure out a way to implement them.

统计信息

  • 总下载量: 331
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2018-04-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固