-
Notifications
You must be signed in to change notification settings - Fork 105
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
Disable link from sortableLink() when there aren't any entries #136
Comments
Could you please elaborate a bit more and provide an example? Yea all PRs are welcome. Most likely you want to take a look at https://github.com/Kyslik/column-sortable/blob/L6/src/ColumnSortable/SortableLink.php#L21 function and do some shenanigans there. |
Sorry for the late reply here.
Sure. Here's my sortable table that has entries: When there are no results on the table, I'd expect the table headings to render as, say, spans instead of links:
It looks like The simplest approach would be to add a new parameter, and make it the responsibility of the caller to determine whether the SortableLink should render. I don't love this though. Can you think of a more elegant approach? |
|
If the collection doesn't contain any entries, it would be nice if
sortableLink()
only displayed the title, and didn't render a link.Happy to submit a pull request if you can provide some direction. My code has a bunch of ugly conditionals right now.
The text was updated successfully, but these errors were encountered: