diff --git a/libs/NiftyGrid/Components/Action.php b/libs/NiftyGrid/Components/Action.php index 4d5cade..4555569 100644 --- a/libs/NiftyGrid/Components/Action.php +++ b/libs/NiftyGrid/Components/Action.php @@ -110,7 +110,7 @@ public function getAction() } if(!empty($this->dialog)){ - $option->addData("grid-confirm", $this->dialog); + $option->addAttribute("grid-confirm", $this->dialog); } return $option; diff --git a/libs/NiftyGrid/Components/Button.php b/libs/NiftyGrid/Components/Button.php index 3a12c9d..c2a6aaf 100644 --- a/libs/NiftyGrid/Components/Button.php +++ b/libs/NiftyGrid/Components/Button.php @@ -241,7 +241,7 @@ public function render($row) if($this->hasConfirmationDialog()){ $el->addClass("grid-confirm") - ->addData("grid-confirm", $this->getConfirmationDialog($row)); + ->addAttribute("grid-confirm", $this->getConfirmationDialog($row)); } if($this->ajax){ diff --git a/libs/NiftyGrid/Components/Column.php b/libs/NiftyGrid/Components/Column.php index 06bf126..d6fba3b 100644 --- a/libs/NiftyGrid/Components/Column.php +++ b/libs/NiftyGrid/Components/Column.php @@ -15,7 +15,7 @@ NiftyGrid\FilterCondition; -class Column extends \Nette\Application\UI\PresenterComponent +class Column extends \Nette\Application\UI\Component { /** @var string */ public $name; @@ -32,6 +32,9 @@ class Column extends \Nette\Application\UI\PresenterComponent /** @var int */ public $truncate; + /** @var callback */ + public $renderer; + /** @var callback */ public $renderCallback; @@ -207,9 +210,9 @@ public function setAutocomplete($numOfResults = 10) } $this->parent['gridForm'][$this->parent->name]['filter'][$this->name]->getControlPrototype() ->addClass("grid-autocomplete") - ->addData("column", $this->name) - ->addData("gridName", $this->parent->getGridPath()) - ->addData("link",$this->parent->link("autocomplete!")); + ->addAttribute("column", $this->name) + ->addAttribute("gridName", $this->parent->getGridPath()) + ->addAttribute("link",$this->parent->link("autocomplete!")); $this->autocomplete = TRUE; diff --git a/libs/NiftyGrid/Components/SubGrid.php b/libs/NiftyGrid/Components/SubGrid.php index d1532e6..b8f911b 100644 --- a/libs/NiftyGrid/Components/SubGrid.php +++ b/libs/NiftyGrid/Components/SubGrid.php @@ -13,7 +13,7 @@ use NiftyGrid, NiftyGrid\Grid; -class SubGrid extends \Nette\Application\UI\PresenterComponent +class SubGrid extends \Nette\Application\UI\Component { /** @var string */ public $name; @@ -24,6 +24,8 @@ class SubGrid extends \Nette\Application\UI\PresenterComponent /** @var callback|string */ private $link; + private $grid; + /** @var callback */ private $settings; diff --git a/libs/NiftyGrid/Grid.php b/libs/NiftyGrid/Grid.php index 574d480..175545a 100644 --- a/libs/NiftyGrid/Grid.php +++ b/libs/NiftyGrid/Grid.php @@ -749,14 +749,14 @@ protected function createComponentGridForm() $form[$this->name]['action']->addSubmit("send","Potvrdit") ->setValidationScope(FALSE) ->getControlPrototype() - ->addData("select", $form[$this->name]["action"]["action_name"]->getControl()->name); + ->addAttribute("select", $form[$this->name]["action"]["action_name"]->getControl()->name); $form[$this->name]->addContainer('perPage'); $form[$this->name]['perPage']->addSelect("perPage","Záznamů na stranu:", $this->perPageValues) ->getControlPrototype() ->addClass("grid-changeperpage") - ->addData("gridname", $this->getGridPath()) - ->addData("link", $this->link("changePerPage!")); + ->addAttribute("gridname", $this->getGridPath()) + ->addAttribute("link", $this->link("changePerPage!")); $form[$this->name]['perPage']->addSubmit("send","Ok") ->setValidationScope(FALSE) ->getControlPrototype() @@ -764,7 +764,7 @@ protected function createComponentGridForm() $form->setTranslator($this->getTranslator()); - $form->onSuccess[] = callback($this, "processGridForm"); + $form->onSuccess[] = [$this, "processGridForm"]; return $form; } @@ -977,4 +977,4 @@ public function getTranslator() return null; } -} \ No newline at end of file +}