Power-Components / livewire-powergrid

⚡ PowerGrid generates modern, powerful and easy-to-customize data tables using Laravel Livewire.
https://livewire-powergrid.com
MIT License
1.41k stars 205 forks source link

no paginating on a table with a collection or array #1490

Closed marineusde closed 3 months ago

marineusde commented 3 months ago

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
 //...
luanfreitasdev commented 3 months ago

Released: https://github.com/Power-Components/livewire-powergrid/releases/tag/v5.4.9