2017 © Pedro Peláez
 

silverstripe-vendormodule silverstripe-dependentdropdownfield

A silverstripe dropdown field that has it's options populated via ajax, based on the value of the field it depends on

image

sheadawson/silverstripe-dependentdropdownfield

A silverstripe dropdown field that has it's options populated via ajax, based on the value of the field it depends on

  • Friday, February 16, 2018
  • by sheadawson
  • Repository
  • 7 Watchers
  • 23 Stars
  • 28,569 Installations
  • PHP
  • 8 Dependents
  • 0 Suggesters
  • 17 Forks
  • 4 Open issues
  • 9 Versions
  • 11 % Grown

The README.md

silverstripe-dependentdropdownfield

A SilverStripe dropdown field that has its options populated via ajax, based on the value of the field it depends on., (*1)

Requirements

SilverStripe 4 || 5, (*2)

Installation

composer require sheadawson/silverstripe-dependentdropdownfield

Usage example

// 1. Create a callable function that returns an array of options for the DependentDropdownField.
// When the value of the field it depends on changes, this function is called passing the
// updated value as the first parameter ($val)
$datesSource = function($val) {
    if ($val == 'one') {
        // return appropriate options array if the value is one.
    }
    if ($val == 'two') {
        // return appropriate options array if the value is two.
    }
};

$fields = FieldList::create(
    // 2. Add your first field to your field list,
    $fieldOne = DropdownField::create('FieldOne', 'Field One', ['one' => 'One', 'two' => 'Two']),
    // 3. Add your DependentDropdownField, setting the source as the callable function
    // you created and setting the field it depends on to the appropriate field
    DependentDropdownField::create('FieldTwo', 'Field Two', $datesSource)->setDepends($fieldOne)
);

The Versions

16/02 2018

dev-master

9999999-dev https://github.com/sheadawson/silverstripe-dependentdropdownfield

A silverstripe dropdown field that has it's options populated via ajax, based on the value of the field it depends on

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

dropdown silverstripe

16/02 2018

2.0.x-dev

2.0.9999999.9999999-dev https://github.com/sheadawson/silverstripe-dependentdropdownfield

A silverstripe dropdown field that has it's options populated via ajax, based on the value of the field it depends on

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

dropdown silverstripe

16/02 2018

2.0.0

2.0.0.0 https://github.com/sheadawson/silverstripe-dependentdropdownfield

A silverstripe dropdown field that has it's options populated via ajax, based on the value of the field it depends on

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

dropdown silverstripe

20/03 2017

1.0.x-dev

1.0.9999999.9999999-dev

A silverstripe dropdown field that has it's options populated via ajax, based on the value of the field it depends on

  Sources   Download

The Requires

 

20/03 2017

1.0.4

1.0.4.0

A silverstripe dropdown field that has it's options populated via ajax, based on the value of the field it depends on

  Sources   Download

The Requires

 

24/05 2016

1.0.3

1.0.3.0

A silverstripe dropdown field that has it's options populated via ajax, based on the value of the field it depends on

  Sources   Download

The Requires

 

22/12 2015

1.0.2

1.0.2.0

A silverstripe dropdown field that has it's options populated via ajax, based on the value of the field it depends on

  Sources   Download

The Requires

 

01/04 2015

1.0.1

1.0.1.0

A silverstripe dropdown field that has it's options populated via ajax, based on the value of the field it depends on

  Sources   Download

The Requires

 

13/09 2014

1.0.0

1.0.0.0

A silverstripe dropdown field that has it's options populated via ajax, based on the value of the field it depends on

  Sources   Download

The Requires