Power-Components / livewire-powergrid

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

Attempt to read property "field" on array #1334

Closed edwinheij closed 7 months ago

edwinheij commented 7 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.14

PowerGrid

5.2.2

Laravel

10.39.0

Livewire

3.3.5

Alpine JS

No response

Theme

Bootstrap

Describe the bug.

When toggling column I got an error: Attempt to read property "field" on array With initial load the $column var is of type PowerComponents\LivewirePowerGrid\Column but after the de-selecting a column the type changed to array. Should we change the templates to the data_get-method or has it something to do with hydrate from Livewire?

To Reproduce...

Just deselect a column from a grid

Extra information

No extra info
luanfreitasdev commented 7 months ago

Can you show more about the error?

edwinheij commented 7 months ago

Just click one of the following options from the column listing:

image

Here's a (clean) repo where it's failing: https://github.com/edwinheij/livewire-powergrid-fail

Error thrown: https://flareapp.io/share/LPl9QqD7

luanfreitasdev commented 7 months ago

Thank you