Nette 2.4. $template is deprecated Nextras\Datagrid

MW
Člen | 615
+
0
-

Zdravím a prosím o radu.

Přešel jsem na verzi Nette 2.4. a používám Nextras\Datagrid (3.0.1).

Mám třídu, kde si dědím od Datagrid :

final class NewGrid extends Datagrid ...

a zde přepisuji metodu Render() (dávám raději celou) :

public function render() {
	if ($this->filterFormFactory) {
	    $this['form']['filter']->setDefaults($this->filter);
	}

	$this->template->data = $this->getData();
	$this->template->columns = $this->columns;
	$this->template->editRowKey = $this->editRowKey;
	$this->template->rowPrimaryKey = $this->rowPrimaryKey;
	$this->template->paginator = $this->paginator;

	foreach ($this->columns as $col) {

	    if ($col->sum == FALSE)
		continue;
	    $c = 'sum' . $col->name;

	    If ($col->col) {
		$this->template->$c = $this->getTotalByOtherColumn($col->col);
	    } else {
		$this->template->$c = $this->getTotal($col->name);
	    }
	}


	foreach ($this->cellsTemplates as &$cellsTemplate) {
	    if ($cellsTemplate instanceof IFileTemplate) {
		$cellsTemplate = $cellsTemplate->getFile();
	    }
	    if (!file_exists($cellsTemplate)) {
		throw new \RuntimeException("Cells template '{$cellsTemplate}' does not exist.");
	    }
	}

	$this->template->cellsTemplates = $this->cellsTemplates;
	$this->template->showFilterCancel = $this->filterDataSource != $this->filterDefaults; // @ intentionaly
	$this->template->setFile(__DIR__ . $this->temp);
	$this->template->render();
    }

a na poslední řádce dostávám

Variable $template is deprecated.

Co dělám blbě nebo jsem přehlédl ?
Moc díky!

ali
Člen | 342
+
0
-

Problem bude v sablone, kde zrejme pouzivas $template promennou.

MW
Člen | 615
+
0
-

Máte pravdu, chyba byla v šabloně. Díky !