nextras / datagrid

Nextras Datagrid component for Nette Framework.
http://nextras.org/datagrid
MIT License
70 stars 39 forks source link

row-actions ignored if filter is not used #64

Closed milsorm closed 7 years ago

milsorm commented 8 years ago

I have grid without filter but with row-actions block in my template.

Inside Datagrid.latte:

{var $hasActionsColumn =
    isset($this->blocks['row-actions']) ||
    isset($this->blocks['global-actions']) ||
    isset($form['filter']) ||
    (bool) $control->getEditFormFactory()
}

When dumped $this->blocks the row-actions is missing. If I create filter form, than $hasActionsColumn will be true (not from row-actions block existence) and I can see all row-actions. Without filter not.

Possibly $this->blocks cannot see MY row-actions but only default blocks in Datagrid.latte?

milsorm commented 8 years ago

My workaround inside Datagrid.latte:

    {ifset #row-actions}{var $hasActionsColumn = 1}{/ifset}

just after than code (because ifset can check existence of block better than $this->blocks).

hrach commented 7 years ago

Thanks for the bugreport and suggested fix!