public function setAlternateText($value) { if (parent::getAlternateText() === $value) { return; } parent::setAlternateText($value); if ($this->getActiveControl()->canUpdateClientSide()) { $this->getPage()->getCallbackClient()->setAttribute($this, 'alt', $value); } }
protected function initializeHeaderCell($cell, $columnIndex) { $text = $this->getHeaderText(); if (($classPath = $this->getHeaderRenderer()) !== '') { $control = Prado::createComponent($classPath); if ($control instanceof \Prado\IDataRenderer) { if ($control instanceof IItemDataRenderer) { $item = $cell->getParent(); $control->setItemIndex($item->getItemIndex()); $control->setItemType($item->getItemType()); } $control->setData($text); } $cell->getControls()->add($control); } else { if ($this->getAllowSorting()) { $sortExpression = $this->getSortExpression(); if (($url = $this->getHeaderImageUrl()) !== '') { $button = new TActiveImageButton(); $button->setImageUrl($url); $button->setCommandName(TDataGrid::CMD_SORT); $button->setCommandParameter($sortExpression); if ($text !== '') { $button->setAlternateText($text); $button->setToolTip($text); } $button->setCausesValidation(false); $cell->getControls()->add($button); } else { if ($text !== '') { $button = new TActiveLinkButton(); $button->setText($text); $button->setCommandName(TDataGrid::CMD_SORT); $button->setCommandParameter($sortExpression); $button->setCausesValidation(false); $cell->getControls()->add($button); } else { $cell->setText(' '); } } } else { if (($url = $this->getHeaderImageUrl()) !== '') { $image = new TActiveImage(); $image->setImageUrl($url); if ($text !== '') { $image->setAlternateText($text); $image->setToolTip($text); } $cell->getControls()->add($image); } else { if ($text !== '') { $cell->setText($text); } else { $cell->setText(' '); } } } } }