Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

Fixes for Nette 2.4 and PHP 7 #45

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion libs/NiftyGrid/Components/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libs/NiftyGrid/Components/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
11 changes: 7 additions & 4 deletions libs/NiftyGrid/Components/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
NiftyGrid\FilterCondition;


class Column extends \Nette\Application\UI\PresenterComponent
class Column extends \Nette\Application\UI\Component
{
/** @var string */
public $name;
Expand All @@ -32,6 +32,9 @@ class Column extends \Nette\Application\UI\PresenterComponent
/** @var int */
public $truncate;

/** @var callback */
public $renderer;

/** @var callback */
public $renderCallback;

Expand Down Expand Up @@ -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;

Expand Down
4 changes: 3 additions & 1 deletion libs/NiftyGrid/Components/SubGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -24,6 +24,8 @@ class SubGrid extends \Nette\Application\UI\PresenterComponent
/** @var callback|string */
private $link;

private $grid;

/** @var callback */
private $settings;

Expand Down
10 changes: 5 additions & 5 deletions libs/NiftyGrid/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -749,22 +749,22 @@ 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()
->addClass("grid-perpagesubmit");

$form->setTranslator($this->getTranslator());

$form->onSuccess[] = callback($this, "processGridForm");
$form->onSuccess[] = [$this, "processGridForm"];

return $form;
}
Expand Down Expand Up @@ -977,4 +977,4 @@ public function getTranslator()

return null;
}
}
}