Toggle button in InfoList
How can I add toggle component to show or hide null value in InfoList?
I have a lot of data row and it would be better if there is a toggle button that allow users to hide or show empty row.
Currently here is my code that only hide null value.
How can I add toggle button to show/hide back the row.
3 Replies
Is this in a Panel or on a custom Livewire component?
This is in panel, no custom Livewire component involved
Ok, the page class is your Livewire component in this case.
I'm not sure but here's an idea you can explore:
- Add a public property on the page class (e.g.
$showNullEntries = false
)
- Toggle this property from a page action (->action(fn ($livewire) => $livewire->showNullEntries = !$livewire->showNullEntries)
)
- Add a check on your hidden
callbacks: (->hidden(fn ($livewire) => !$livewire->showNullEntries)
)