dev-master
9999999-devAdd helper functions to reorder fields in a FieldList
BSD-3-Clause
The Requires
silverstripe order fieldlist
Wallogit.com
2017 © Pedro Peláez
Add helper functions to reorder fields in a FieldList
Add helper functions to reorder fields in a FieldList. You can easily move a field to appear before and after other fields., (*1)
Example:, (*2)
public function getCMSFields() {
$fields = parent::getCMSFields();
// Move ModeOfAttendance relation before the Day field
$fields->moveBefore('ModeOfAttendanceID','Day');
// Move the Intake relation after the ModeOfAttendance relation
$fields->moveAfter('IntakeTypeID','ModeOfAttendanceID');
return $fields;
}
For the source field parameter (first argument), you can pass in a field or a field name., (*3)
composer require "svandragt/silverstripe-fieldlistmovefield:*", (*4)
The code is straightforward so should work on any 3.x installation., (*5)
Add helper functions to reorder fields in a FieldList
BSD-3-Clause
silverstripe order fieldlist