mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
2.0 KiB
2.0 KiB
4.3.0
Overview
DataList::column()
now returns all values and not just "distinct" values from a column as per the API docsDataList
,ArrayList
andUnsavedRalationList
all havecolumnUnique()
method for fetching distinct column values- Take care with
stageChildren()
overrides.Hierarchy::numChildren()
results will only make use ofstageChildren()
customisations that are applied to the base class and don't include record-specific behaviour. - New React-based search UI for the CMS, Asset-Admin, GridFields and ModelAdmins.
- A new
GridFieldLazyLoader
component can be added toGridField
. This will delay the fetching of data until the user access the container Tab of the GridField.
Upgrading
Fetching distinct column values on DataList
Prior to this release DataList
would erroneously return a distinct list of values from a column on an object.
If this behaviour is still required, please use columnUnique()
instead.
Using legacy GridField search API
GridFields now default to using the new search UI which uses SilverStripe's FormSchema API.
If you would rather continue using the old search API, you can remove the default GridFieldFilterHeader
from your GridField configuration and replace with one whose legacy flag has been enabled.
To enable the legacy search API on a GridFieldFilterHeader
, you can either:
- set the
useLegacyFilterHeader
property totrue
, - or pass
true
to the first argument of its constructor.
public function getCMSFields()
{
$fields = parent::getCMSFields();
// Configure grid field to use legacy search API
$config = new GridFieldConfig_RecordEditor();
$config->getComponentsByType(GridFieldFilterHeader::class)->useLegacyFilterHeader = true;
$grid = GridField::create('Companies', 'Companies', DataList::create(Company::class), $config);
$fields->addFieldToTab('Root.Company', $grid);
return $fields;
}