Item actions as links #1815
dorianamouroux
started this conversation in
Ideas
Replies: 1 comment
-
|
Hey, thanks for the suggestion. I've transferred this into an issue and opened a PR. See #1855 I named the callback I guess we don't need a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey!
First off, thanks for Backpex, we're using it for our admin and it's been really smooth.
One thing we've run into: item actions are always rendered as
<button>withphx-click="item-action", so every click goes through the server. For simple navigation actions (e.g. "Show", "Edit", or custom links), that's a bit heavy.We'd love to have an option for link-style item actions that render as real
<a href="...">instead of buttons.Why we'd find it useful:
Rough idea:
Something like a type: :link (or similar) on the action config: where the action module provides a way to compute the URL (e.g. a path(socket, item) callback or the like) instead of (or in addition to) handle/3:
For those actions, the template would render an with the same icon/label/tooltip, and skip the phx-click="item-action" flow.
No strong opinion on the exact API — just wanted to float the idea and see what you think. Happy to help with a PR if you're open to it.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions