removeByName('Default'); return $fields; } public function getFormField() { $field = DropdownField::create($this->Name, $this->Title) ->setSource(i18n::getData()->getCountries()) ->setFieldHolderTemplate(EditableFormField::class . '_holder') ->setTemplate(EditableDropdown::class); $this->doUpdateFormField($field); return $field; } public function getValueFromData($data) { if (isset($data[$this->Name])) { $source = $this->getFormField()->getSource(); return $source[$data[$this->Name]]; } } public function getIcon() { $resource = ModuleLoader::getModule('silverstripe/userforms')->getResource('images/editabledropdown.png'); if (!$resource->exists()) { return ''; } return $resource->getURL(); } public function getSelectorField(EditableCustomRule $rule, $forOnLoad = false) { return "$(\"select[name='{$this->Name}']\")"; } }