/**
  * {@inheritdoc}
  */
 public function getEditHtml()
 {
     $iblockId = (int) $this->getSettings('IBLOCK_ID');
     $inputSize = (int) $this->getSettings('INPUT_SIZE');
     $windowWidth = (int) $this->getSettings('WINDOW_WIDTH');
     $windowHeight = (int) $this->getSettings('WINDOW_HEIGHT');
     $name = 'FIELDS';
     $key = $this->getCode();
     $elementId = $this->getValue();
     if (!empty($elementId)) {
         $rsElement = ElementTable::getById($elementId);
         if (!($element = $rsElement->fetchAll())) {
             $element['NAME'] = Loc::getMessage('IBLOCK_ELEMENT_NOT_FOUND');
         }
     } else {
         $elementId = '';
     }
     return '<input name="' . $this->getEditInputName() . '"
                  id="' . $name . '[' . $key . ']"
                  value="' . $elementId . '"
                  size="' . $inputSize . '"
                  type="text">' . '<input type="button"
                 value="..."
                 onClick="jsUtils.OpenWindow(\'/bitrix/admin/iblock_element_search.php?lang=' . LANGUAGE_ID . '&amp;IBLOCK_ID=' . $iblockId . '&amp;n=' . $name . '&amp;k=' . $key . '\', ' . $windowWidth . ', ' . $windowHeight . ');">' . '&nbsp;<span id="sp_' . md5($name) . '_' . $key . '" >' . static::prepareToOutput($element['NAME']) . '</span>';
 }
 /**
  * {@inheritdoc}
  */
 public function generateRow(&$row, $data)
 {
     $elementId = $this->getValue();
     if (!empty($elementId)) {
         $rsElement = ElementTable::getById($elementId);
         $element = $rsElement->fetch();
         $html = '<a href="/bitrix/admin/iblock_element_edit.php?IBLOCK_ID=' . $element['IBLOCK_ID'] . '&type=' . $element['IBLOCK_TYPE_ID'] . '&ID=' . $elementId . '&lang=ru">[' . $elementId . '] ' . static::prepareToOutput($element['NAME']) . '</a>';
     } else {
         $html = '';
     }
     $row->AddViewField($this->getCode(), $html);
 }