Skip to content

Commit

Permalink
NEW SearchableDropdownField
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Nov 28, 2023
1 parent cfd8f05 commit f6356dc
Show file tree
Hide file tree
Showing 6 changed files with 862 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lang/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ en:
IsNullLabel: 'Is Null'
SilverStripe\Forms\NumericField:
VALIDATION: "'{value}' is not a number, only numbers can be accepted for this field"
SilverStripe\Forms\SearchableDropdownTrait:
SELECT: 'select'
TYPE_TO_SEARCH: 'type to search'
CONJUNCTIVE: ' or '
DOTS: '...'
SilverStripe\Forms\TextField:
VALIDATEMAXLENGTH: 'The value for {name} must not exceed {maxLength} characters in length'
SilverStripe\Forms\TimeField:
Expand Down
18 changes: 18 additions & 0 deletions src/Forms/SearchableDropdownField.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace SilverStripe\Forms;

use SilverStripe\Forms\DropdownField;

class SearchableDropdownField extends DropdownField
{
use SearchableDropdownTrait;

// This needs to be defined on the class, not the trait, or else a there is a PHP error
protected $schemaComponent = 'SearchableDropdownField';

protected function init(): void
{
// noop
}
}
Loading

0 comments on commit f6356dc

Please sign in to comment.