Giter VIP home page Giter VIP logo

silverstripe-sectioned-grid-field's Introduction

Silverstripe-Sectioned-Grid-Field

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.

silverstripe-sectioned-grid-field's People

Contributors

makreig avatar ucenna avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

muskie9 makreig

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.