contributte / contributte/datagrid
Is there a possibility of disabling default sorting?
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 296
- Forks
- 215
- PR merge metrics
- No merged PRs in 30d
Description
As a data source, I have wrapped SQL with necessary ordering. Datagrid generates this SQL:
SELECT *
FROM (
select *
from user
order by name) val
ORDER BY "id" ASC
LIMIT 15
So, I want to disable default sorting by primary key. Is it possible?
p.s. you have a typo in documentation here:
https://ublaboo.org/datagrid/column
$grid->setDefaultSort('id' => 'DESC', FALSE);
should be:
$grid->setDefaultSort(['id' => 'DESC'], FALSE);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the reported generated SQL and the setDefaultSort example at https://ublaboo.org/datagrid/column. Determine how default primary-key sorting can be disabled without changing the wrapped query, and correct the documentation typo; done means both the sorting behavior and the documented example are fixed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100