Skip to content

Custom default sort direction - #200

Closed
ezra-obiwale wants to merge 4 commits into
Kyslik:masterfrom
ezra-obiwale:master
Closed

Custom default sort direction#200
ezra-obiwale wants to merge 4 commits into
Kyslik:masterfrom
ezra-obiwale:master

Conversation

@ezra-obiwale

@ezra-obiwale ezra-obiwale commented May 20, 2022

Copy link
Copy Markdown

Ensures overriding the direction in the query parameter works as expected.

@sortablelink('column', 'columnTitle', ['direction' => 'desc'])

@Darthmaul

Copy link
Copy Markdown

Hello - I would really love to see this PR implemented. I just got a request from a user to implement this functionality and this PR would resolve. Thanks for your work!

@robbielove

Copy link
Copy Markdown

This is already possible by passing direction as an associative array to the third parameter:

$columnSpecificData['name'] = ['direction' => 'desc'];

@sortablelink('name', 'Name', $columnSpecificData['name'])

$columnSpecificData['other'] = ['direction' => 'asc'];

@sortablelink('other', 'Other', $columnSpecificData['other'])

@ezra-obiwale

Copy link
Copy Markdown
Author

@robbielove I tested it as you mentioned above however, the direction was still being overridden by the determined direction.

I've updated this PR to fix that.

@robbielove

Copy link
Copy Markdown

yeah sorry it's in other PR's

see #188 #194

@ezra-obiwale

Copy link
Copy Markdown
Author

Cool. Shutting this down then.

Could you maybe see about merging one of those PRs? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants