Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow closure based table Group labels #15196

Open
wants to merge 2 commits into
base: 3.x
Choose a base branch
from

Conversation

ralphjsmit
Copy link
Contributor

@ralphjsmit ralphjsmit commented Dec 28, 2024

This PR allows the getLabel() method of Table Groups to be based on a closure. It also ensures that the group evaluation parameters for $table/$livewire are correctly received. In line with other code the table is set on the group as soon as possible (when pushing the groups), or on instantiation of the groups when only providing the string attribute.

Thanks!

Comment on lines +89 to +93
foreach ($groups as $group) {
if ($group instanceof Group) {
$group->table($this);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If groups are passed in a closure I don't think the table gets passed, I think the table needs to be injected in when the groups property is consumed

Comment on lines +75 to +77
if ($group instanceof Group) {
$group->table($this);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this to the place where the defaultGroup gets read so if we introduce closure support this won't break

@danharrin danharrin added the enhancement New feature or request label Dec 31, 2024
@danharrin danharrin added this to the v3 milestone Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants