From e130f0ddf6f4b9a29dfc36dec0b95d3e9b4ed4e2 Mon Sep 17 00:00:00 2001 From: Jakub Fajkus Date: Wed, 27 Nov 2019 14:26:59 +0100 Subject: [PATCH] The reset column filter functionality is broken, when the datagrid component is nested inside another component. --- assets/src/datagrid.coffee | 12 ------------ src/DataGrid.php | 2 +- src/templates/datagrid.latte | 2 +- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/assets/src/datagrid.coffee b/assets/src/datagrid.coffee index 24bec89e..f84c2061 100644 --- a/assets/src/datagrid.coffee +++ b/assets/src/datagrid.coffee @@ -722,16 +722,4 @@ $.nette.ext('datagrid.reset-filter-by-column', { if payload.non_empty_filters && payload.non_empty_filters.length for key in payload.non_empty_filters grid.find('[data-datagrid-reset-filter-by-column='+key+']').removeClass('hidden') - - # Refresh their url (table header is not refreshed using snippets) - # - href = grid.find('.reset-filter').attr('href') - - grid.find('[data-datagrid-reset-filter-by-column]').each -> - key = $(this).attr('data-datagrid-reset-filter-by-column') - - new_href = href.replace('do=' + payload._datagrid_name + '-resetFilter', 'do=' + payload._datagrid_name + '-resetColumnFilter') - new_href += '&' + payload._datagrid_name + '-key=' + key - - $(this).attr('href', new_href) }) diff --git a/src/DataGrid.php b/src/DataGrid.php index ac72bbe9..5109f42c 100644 --- a/src/DataGrid.php +++ b/src/DataGrid.php @@ -541,7 +541,6 @@ public function render() $template->filter_active = $this->isFilterActive(); $template->original_template = $this->getOriginalTemplateFile(); $template->icon_prefix = static::$icon_prefix; - $template->icon_prefix = static::$icon_prefix; $template->items_detail = $this->items_detail; $template->columns_visibility = $this->getColumnsVisibility(); $template->columnsSummary = $this->columnsSummary; @@ -2520,6 +2519,7 @@ public function reload($snippets = []) { if ($this->getPresenter()->isAjax()) { $this->redrawControl('tbody'); + $this->redrawControl('thead'); $this->redrawControl('pagination'); $this->redrawControl('summary'); $this->redrawControl('thead-group-action'); diff --git a/src/templates/datagrid.latte b/src/templates/datagrid.latte index 13ccab29..b581a359 100644 --- a/src/templates/datagrid.latte +++ b/src/templates/datagrid.latte @@ -73,7 +73,7 @@ {/block} {/if} - +
{if $hasGroupActions}