/** * @param $name * @param array $options * * @return $this * @throws \Exception */ private function _addDataList($name, $options) { if ($options) { $field = $this->getField($name); $fieldId = $field->getId(); $dataListId = $fieldId . '_datalist'; $field->setAttributes(['list' => $dataListId]); $dataList = new Field($name, InputTypeEnum::DATALIST); $dataList->setOptions($options); $dataList->setId($dataListId); $this->_datalists[$name] = $dataList; } return $this; }