定制 briceburg/silverstripe-pickerfield 二次开发

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

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

briceburg/silverstripe-pickerfield

最新稳定版本:0.9.0

Composer 安装命令:

composer require briceburg/silverstripe-pickerfield

包简介

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

README 文档

README

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

Requirements

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.

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

Usage Overview

Screenshots; ###overview overview ###link button search [via GridFieldExtensions] link button search [via GridFieldExtensions]

/***********************
	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;

统计信息

  • 总下载量: 41.15k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 25
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 25
  • Watchers: 4
  • Forks: 28
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-06-13