From 49551ef8480bad80c474a34cee9f3c579f297d60 Mon Sep 17 00:00:00 2001 From: alloylab Date: Sat, 21 Dec 2024 10:05:08 -0600 Subject: [PATCH] Fixes Column Summaries w/ Defer Loading (#1815) * Summary Fixes Fixes incorrect labels on footer blade, addresses issue in DataSourceBase with Summaries not displaying, and updates PowerGridComponent so summaries update with changes to the table * Fix applySummaries Column type cast array to column var so it has consistent type for defer_loading = true/false * Fixes for Tests * Temp Remove Dehydrate --------- Co-authored-by: luanfreitasdev --- resources/views/components/table-footer.blade.php | 2 +- src/DataSource/Processors/DataSourceBase.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/views/components/table-footer.blade.php b/resources/views/components/table-footer.blade.php index 3147def0..a496ce0f 100644 --- a/resources/views/components/table-footer.blade.php +++ b/resources/views/components/table-footer.blade.php @@ -1,6 +1,6 @@ {{-- blade-formatter-enable --}} @if (data_get($setUp, 'detail.showCollapseIcon')) component->columns = collect($this->component->columns) ->map(function (array|\stdClass|Column $column) use ($results, $applySummaryFormat) { + $column = (object) $column; + $field = strval(data_get($column, 'dataField')) ?: strval(data_get($column, 'field')); $summaries = ['sum', 'count', 'avg', 'min', 'max'];