2017 © Pedro Peláez
 

silverstripe-module silverstripe-pickerfield

GridField based management of has_one , has_many , and many_many relationship selection

image

briceburg/silverstripe-pickerfield

GridField based management of has_one , has_many , and many_many relationship selection

  • Wednesday, March 29, 2017
  • by briceburg
  • Repository
  • 4 Watchers
  • 25 Stars
  • 23,114 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 12 Forks
  • 4 Open issues
  • 2 Versions
  • 6 % Grown

The README.md

silverstripe-pickerfield

SilverStripe 3 GridField based management of has_one , has_many , and many_many relationship selection, (*1)

Requirements

  • SilverStripe >= 3.1
  • Andrew Short's GridFieldExtensions [ https://github.com/ajshort/silverstripe-gridfieldextensions ]

Why?

  1. An efficient* GridField based interface to manage relationship selections.
  2. GridField doesn't appear to natively support has_one relationships.
  3. The ability to edit and create selected items.

Thanks to the great work of the SilverStripe team and Andrew Short's GridFieldExtensions, the development of this module was a bit easier. Be kind to them., (*2)

* by efficient we needed ajax + pagination, as we couldn't load all records into a dropdown list for instance., (*3)

Usage Overview

Screenshots;, (*4)

overview

overview, (*5)

link button search [via GridFieldExtensions], (*6)


/*********************** Mock DataObject ************************/ class Dog extends DataObject { static $db = array( 'Title' => 'Varchar', // .... ); static $has_one = array( 'Breeder' => 'Breeder' 'Dam' => 'Dog', 'Sire' => 'Dog', // .... ); static $has_many = array( 'Owners' => 'Member', // .... ); // .... } /*********************** Field Usage ************************/ // sortable field appropriate for selection of has_many and many_many objects $field = new PickerField('Owners', 'Owners', $this->Owners(), 'Select Owner(s)', 'SortOrder'); // non-sortable version of the above $field = new PickerField('Owners', 'Owners', $this->Owners()); // sortable field appropriate for the parent selection of a has_one relationship $field = new HasOnePickerField($this, 'DamID', 'Selected Dam', $this->Dam(), 'Select a Dam'); // we also allow the ability to create and edit associated records via enableCreate, enableEdit methods. $fields->addFieldsToTab('Root.Main', array( new HeaderField('Info','Info Blocks'), $field = new HasOnePickerField($this, 'AboutInfoBlockID', 'About Block', $this->AboutInfoBlock()) )); $field->enableCreate('Add Block')->enableEdit();

Bugs

For support or questions, please use the GitHub provided issue tracker; * https://github.com/briceburg/silverstripe-pickerfield/issues, (*7)

The Versions

29/03 2017

dev-master

9999999-dev https://github.com/briceburg/silverstripe-pickerfield

GridField based management of has_one , has_many , and many_many relationship selection

  Sources   Download

BSD-3-Clause

The Requires

 

by Brice Burgess

silverstripe gridfield has_one

02/11 2015

0.9.0

0.9.0.0 https://github.com/briceburg/silverstripe-pickerfield

GridField based management of has_one , has_many , and many_many relationship selection

  Sources   Download

BSD-3-Clause

The Requires

 

by Brice Burgess

silverstripe gridfield has_one