-
Notifications
You must be signed in to change notification settings - Fork 258
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
Adds ability to sort by multiple columns (multisort) #359
base: master
Are you sure you want to change the base?
Conversation
* Adds ability to sort by multiple columns (multisort) Authored-by: Antonis Antoniou <[email protected]> and Michalis Antoniou <[email protected]>
Hey, @kountouris7 i have sort of taken over the maintainership of livewire-datatables and would like to merge your awesome feature. |
Hello, yes i will try and resolve the conflicts asap. Thanks |
Hey @thyseus some tests seems to be failing in MedicOneSystems:master and it will be extremely difficult to resolve conflicts. Please let me know if i am missing something. |
…nflicts_2022 # Conflicts: # README.md # resources/views/livewire/datatables/datatable.blade.php # resources/views/livewire/datatables/header-no-hide.blade.php # src/Http/Livewire/LivewireDatatable.php
# Conflicts: # CHANGELOG.md # README.md # resources/views/livewire/datatables/datatable.blade.php # resources/views/livewire/datatables/header-no-hide.blade.php # src/Http/Livewire/LivewireDatatable.php
…rom outdated master
Hey @thyseus conflicts are now resolved. Please let me know what you think. |
Wow, @kountouris7 that looks like a lot of work you have done there. Also the tests look very intense ! There are some minor style issues here : https://github.styleci.io/analyses/O3v34B Unfortunately i am not able to put your tests to this automatic github workflow pipeline but i will try your new feature in the beginning of next week at my local office machine, run the tests there, and may merge it when everything is fine. Thanks a lot for all that work :) |
Hey @thyseus . Thanks. Should i take care of the style issue here or you will do that? |
Hi there! Thanks for this great package. I'd like to contribute a feature that lets the user sort by multiple columns (multisort). It resolves this issue. Please take a look whenever you get a chance and let me know if you'd like me to make any changes. Thanks!
Summary
This PR introduces "multisort", a feature that allows sorting datatables by multiple columns.
Key changes in
LivewireDatatable
classMultisort can be toggled through property
$multisort
. Multisort is disabled by default.$sort property can now hold an array when in $multisort = true.
$direction
property inLivewireDatatable
has been removed. Each column s now has its own direction, The possible values for direction areasc, desc, null
. Example 'column1|asc', 'column2|desc'New tests:
In LivewireDatatableTemplateTest:
it_can_set_sort_from_property_using_column_index, it_can_set_multisort_from_property_using_array, it_can_set_sort_from_property_using_column_name_and_direction, it_can_set_sort_from_property_using_column_index_and_direction
LivewireDatatableMultisortQueryBuilderTest, PutSortToSessionTest
Update (Sept 2022):