Skip to content
This repository was archived by the owner on Mar 10, 2021. It is now read-only.
Open
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions libs/NiftyGrid/Components/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class Action extends \Nette\Application\UI\PresenterComponent
/** @var boolean */
public $ajax = TRUE;

/** @var string */
public $group;

/**
* @param string $name
* @return Action
Expand Down Expand Up @@ -115,4 +118,15 @@ public function getAction()

return $option;
}

/**
* @param string $group
* @return Action
*/
public function setGroup($group)
{
$this->group = $group;

return $this;
}
}
9 changes: 8 additions & 1 deletion libs/NiftyGrid/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,14 @@ protected function attached($presenter)
if($this->hasActionForm()){
$actions = array();
foreach($this['actions']->components as $name => $action){
$actions[$name] = $action->getAction();
if($action->group)
{
$actions[$action->group][$name] = $action->getAction();
}
else
{
$actions[$name] = $action->getAction();
}
}
$this['gridForm'][$this->name]['action']['action_name']->setItems($actions);
}
Expand Down