Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
71 lines (63 sloc) 1.84 KB
{**
* This file is part of the Nextras community extensions of Nette Framework
*
* @license MIT
* @link https://github.com/nextras
*}
<div class="grid" data-grid-name="{$control->getUniqueId()}">
{snippet rows}
{var $_templates = []}
{foreach $cellsTemplates as $cellsTemplate}
{php
$_template = $this->createTemplate($cellsTemplate, $this->params, "includeblock");
$_template->render();
$_templates[] = $_template;
}
{/foreach}
{form form class => 'ajax'}
{php
$hasActionsColumn =
(bool) $control->getEditFormFactory() /* we may render only one row so the form[filter] may not be created */
|| isset($this->blockQueue["row-actions"]);
$hasGlobalActionsColumn = isset($form['actions']);
foreach ($_templates as $_template):
$_template->params['hasActionsColumn'] = $hasActionsColumn;
$_template->params['hasGlobalActionsColumn'] = $hasGlobalActionsColumn;
endforeach;
$this->params['hasActionsColumn'] = $hasActionsColumn;
$this->params['hasGlobalActionsColumn'] = $hasGlobalActionsColumn;
}
{include #table-open-tag}
<thead>
{include #row-head-columns}
{ifset $form['filter']}
{include #row-head-filter}
{/ifset}
</thead>
<tbody>
{if count($data)}
{foreach $data as $row}
{var $primary = $control->getter($row, $rowPrimaryKey)}
{var $rowId = $this->global->snippetDriver->getHtmlId("rows-$primary")}
{include #row row => $row, rowId => $rowId}
{/foreach}
{else}
{ifset #empty-result}{include #empty-result}{/ifset}
{/if}
</tbody>
<tfoot n:if="isset($paginator) || $hasGlobalActionsColumn">
<tr>
<th colspan="{=count($columns) + $hasGlobalActionsColumn + $hasActionsColumn}">
{if $hasGlobalActionsColumn}
{include #global-actions}
{/if}
{ifset $paginator}
{include #pagination}
{/ifset}
</th>
</tr>
</tfoot>
{include #table-close-tag}
{/form}
{/snippet}
</div>
You can’t perform that action at this time.