webbuilders-group/silverstripe-limitedrelationsgridfield
最新稳定版本:3.0.0
Composer 安装命令:
composer require webbuilders-group/silverstripe-limitedrelationsgridfield
包简介
Adds the ability to limit the number of items in the relationship managed by GridField.
README 文档
README
Adds the ability to limit the number of items in the relationship managed by GridField.
Maintainer Contact
- Ed Chipman (UndefinedOffset)
Requirements
- SilverStripe CMS ~6.0
Installation
Composer (recommended):
composer require webbuilders-group/silverstripe-limitedrelationsgridfield
Usage
For many_many relationships simply swap the configuration for the GridField with LRGridFieldConfig_RelationEditor, for example.
//Create a GridField instance with a page length of 10 and a item cound limit of 20 new GridField('MyGridField', 'My GridField', $this->Relationship(), LRGridFieldConfig_RelationEditor::create(10, 20));
For has_many relationships simply swap the configuration for the GridField with LRGridFieldConfig_RecordEditor, for example.
//Create a GridField instance with a page length of 10 and a item cound limit of 20 new GridField('MyGridField', 'My GridField', $this->Relationship(), LRGridFieldConfig_RecordEditor::create(10, 20));
Configuration Options
The LRGridFieldAddExistingAutocompleter component provides a single method that allows changing of the limit, as well this limit can be set as the 3rd parameter to the constructor.
$myLimitedAutoCompleter->setItemLimit(3); //Change the item limit to 3
The LRGridFieldDetailForm component provides a single method that allows changing of the limit, as well this limit can be set as the 2nd parameter to the constructor.
$myLimitedDetailForm->setItemLimit(3); //Change the item limit to 3
统计信息
- 总下载量: 1.87k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-09-03