2017 © Pedro Peláez
 

silverstripe-module silverstripe-fieldlistmovefield

Add helper functions to reorder fields in a FieldList

image

svandragt/silverstripe-fieldlistmovefield

Add helper functions to reorder fields in a FieldList

  • Thursday, April 14, 2016
  • by svandragt
  • Repository
  • 1 Watchers
  • 4 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

silverstripe-fieldlistmovefield

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)

Installation

composer require "svandragt/silverstripe-fieldlistmovefield:*", (*4)

The code is straightforward so should work on any 3.x installation., (*5)

The Versions

14/04 2016

dev-master

9999999-dev

Add helper functions to reorder fields in a FieldList

  Sources   Download

BSD-3-Clause

The Requires

 

silverstripe order fieldlist