Power-Components / livewire-powergrid

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

$primaryKey Causes Action Buttons To Disappear #1730

Closed nilios closed 1 month ago

nilios commented 1 month 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.3

PowerGrid

6.0.2

Laravel

11.28

Livewire

3.5.11

Alpine JS

3.14.1

Theme

Tailwind 3.x with tailwind/forms

Describe the bug.

Didn't see this get created. As discussed in #1716 , when setting $primaryKey on a table the action buttons disappear.

To Reproduce...

add public string $primaryKey = 'table.id'; to a table and the action buttons will not be shown.

Extra information

No response

luanfreitasdev commented 1 month ago

Hi @nilios, you can set $realPrimaryKey in the component and it works fine, but this needs to be documented.

public string $primaryKey = 'dishes.id';

public string $realPrimaryKey = 'id';
nilios commented 1 month ago

Thank you for the explanation. I used $realPrimaryKey as you suggested and the action buttons remained in place and all functionality seemed to work as expected. I didn't see PekoKent create an issue so I thought it was still unresolved. Thanks again!

luanfreitasdev commented 1 month ago

Thank you!