Skip to content

Commit 49551ef

Browse files
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 <[email protected]>
1 parent f40eeba commit 49551ef

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

resources/views/components/table-footer.blade.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{-- blade-formatter-enable --}}
22
<tr
3-
class="{{ theme_style($theme, 'table.header.tr') }}"
3+
class="{{ theme_style($theme, 'table.footer.tr') }}"
44
>
55
@if (data_get($setUp, 'detail.showCollapseIcon'))
66
<td

src/DataSource/Processors/DataSourceBase.php

+2
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ protected function applySummaries(MorphToMany|EloquentBuilder|BaseCollection|Que
241241

242242
$this->component->columns = collect($this->component->columns)
243243
->map(function (array|\stdClass|Column $column) use ($results, $applySummaryFormat) {
244+
$column = (object) $column;
245+
244246
$field = strval(data_get($column, 'dataField')) ?: strval(data_get($column, 'field'));
245247

246248
$summaries = ['sum', 'count', 'avg', 'min', 'max'];

0 commit comments

Comments
 (0)