public function getElementForRender($tag, $key, Row $row = null)
	{
		if ($this->elementCache[$tag]) {
			$el = clone $this->elementCache[$tag];
		} else {
			$el = Html::el($tag);
		}

		/**
		 * If class was set by user via $el->class = '', fix it
		 */
		if (!empty($el->class) && is_string($el->class)) {
			$class = $el->class;
			unset($el->class);

			$el->class[] = $class;
		}

		$el->class[] = "text-{$this->getAlign()}";
		$el->class[] = "col-{$key}";

		if ($row && $tag == 'td' && $this->isEditable($row)) {
			$link = $this->grid->link('edit!', ['key' => $key, 'id' => $row->getId()]);

			$el->data('datagrid-editable-url', $link);

			$el->data('datagrid-editable-type', $this->editable_element[0]);
			$el->data('datagrid-editable-attrs', json_encode($this->editable_element[1]));

			if ($this->getEditableValueCallback()) {
				$el->data(
					'datagrid-editable-value',
					call_user_func_array($this->getEditableValueCallback(), [$row->getItem()])
				);
			}
		}

		return $el;
	}