-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
Fix - Allows Label Columns to be Sortable #1256
Fix - Allows Label Columns to be Sortable #1256
Conversation
Needs some minor further testing before merging. |
As far as I can tell, this is now ready @rappasoft - although I'd appreciate you giving it a quick poke before I merge! This enables a "label" column to be Sortable (via the callback), presently this does not work. Column::make('Name Label')
->sortable(function (Builder $query, string $direction) {
return $query->orderBy('name', $direction);
})
->label(fn($row, Column $column) => $row->name), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No change here, just whitespacing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No change here, just whitespacing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduction of "isColumnBySlug" which is used to determine if the Column is an actual column based on the Slug, if it can't be found based on field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes an attempt to find the Column based on the SelectName first, but then swaps over to Slug if it can't find the Column.
This allows the Column to be sortable if it has a sortCallback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes an attempt to find the Column based on the Slug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails over to finding the Column by Slug if it can't by SelectName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This defaults to getColumnSelectName if it is associated with a field. But fails over to finding the Column based on Slug if not.
Any date to release this one? It is really required. Thanks! |
I'm just waiting on @rappasoft to give it a quick skim, but it'll be in the next release, most likely next weekend. |
Looks good to me! |
Thanks @rappasoft Will merge into develop later today. |
Now in develop - feel free to test if you are using the develop branch @rhnkyr |
Presently in testing
This adds the capability for label-only columns to be sortable, by checking first for the Column by Select Name, but if that is null, checks for the column's existence by Slug Name.
All Submissions:
New Feature Submissions:
Changes to Core Features: