Dynamic\FoxyStripe\Form\FoxyStripeDropdownField
Dropdown field, created from a <select> tag. This field handles cart encryption based on store settings.
<b>Populate with Array</b>.
Example instantiation:
<code>
FoxyStripeDropdownField::create('Country')
->setSource(array(
'NZ' => 'New Zealand',
'US' => 'United States',
'GEM'=> 'Germany'
));
</code>
<b>Populate with Enum-Values</b>
You can automatically create a map of possible values from an </code>
Field construction:
<code>
FoxyStripeDropdownField::create('Country')
->setSource(singleton('MyObject')->dbObject('Country')->enumValues());
</code>
<b>Disabling individual items</b>
Individual items can be disabled by feeding their array keys to setDisabledItems.
<code>
$DrDownField->setDisabledItems( array( 'US', 'GEM' ) );
</code>
Synopsis
class FoxyStripeDropdownField
extends DropdownField
{
- // methods
- public $this setDisabledItems()
- public $this setSource()
Hierarchy
Extends
- SilverStripe\Forms\DropdownField
Methods
public
- setDisabledItems() — Mark certain elements as disabled, regardless of the {@link setDisabled()} settings.
- setSource()