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

no paginating on a table with a collection or array

marineusde opened this issue · comments

Have you searched through other issues to see if your problem is already reported or has been fixed?

Yes, I did not find it.

Did you read the documentation?

Yes, I did not find it.

Have you tried to publish the views?

Yes - I didn't work.

Is there an error in the console?

No

PHP Version

8.2.7

PowerGrid

5.4.8

Laravel

10.48.4

Livewire

3.4.9

Alpine JS

No response

Theme

Bootstrap

Describe the bug.

the footer with the paginating is not shown

To Reproduce...

final class TestTable extends PowerGridComponent
{
    public function datasource(): ?Collection
    {
        $collection = new Collection;
        for ($i = 1; $i <= 20; $i++) {
            $collection->add([
                'id' => $i,
                'name' => 'Name ' . $i
            ]);
        }

        return $collection;
    }

    public function setUp(): array
    {
        return [
            Header::make(),
            Footer::make()
                ->showPerPage(),
        ];
    }

    public function fields(): PowerGridFields
    {
        return PowerGrid::fields()
            ->add('id')
            ->add('name');
    }

    public function columns(): array
    {
        return [
            Column::make('ID', 'id'),
            Column::make('Name', 'name'),
        ];
    }
}

Extra information

<?php
 //...