Skip to content
This repository was archived by the owner on Mar 10, 2021. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion libs/NiftyGrid/Components/GlobalButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class GlobalButton extends \Nette\Application\UI\PresenterComponent
/** @var bool */
private $ajax = TRUE;

/** @var string */
private $text;

/**
* @param string $label
* @return Button
Expand Down Expand Up @@ -81,14 +84,26 @@ public function setAjax($ajax = TRUE)
return $this;
}

/**
* @param string $text
* @return Button
*/
public function setText($text)
{
$this->text = $text;

return $this;
}

public function render()
{
$el = Html::el("a")
->href($this->getLink())
->setClass($this->class)
->addClass("grid-button")
->addClass("grid-global-button")
->setTitle($this->label);
->setTitle($this->label)
->setText($this->text);

if($this->getName() == Grid::ADD_ROW) {
$el->addClass("grid-add-row");
Expand Down