Power-Components / livewire-powergrid

⚡ PowerGrid generates modern, powerful and easy-to-customize data tables using Laravel Livewire.

Home Page:https://livewire-powergrid.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Column Summary Doesn't work when using Collections.

luanfreitasdev opened this issue · comments

Discussed in #1554

Originally posted by abhaypithadiya May 16, 2024
I have a datasource which returns a collection.

    public function datasource(): ?Collection
    {
        return $this->productCollection;
    }

When I use any column summary it doesn't display.

            Column::make('Gross Wt', 'gross_wt')
                ->withSum('Total Gross Wt', true, false)
                ->searchable()
                ->sortable(),

Does this feature only work for Eloquent? I couldn't find anything in the documentation.