Skip to content
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

not necessary disable dataProvider->sort #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nadirvishun
Copy link
Contributor

why display dataProvider->sort?
if it disable we only can use:

$dataProvider = new ActiveDataProvider([
            'query' => BackendMenu::find()->orderBy(['sort' => SORT_ASC, 'id' => SORT_ASC]),
]);

but usually we use in this way:

$dataProvider = new ActiveDataProvider([
            'query' => BackendMenu::find(),
            'sort' => ['defaultOrder' => ['sort' => SORT_ASC, 'id' => SORT_ASC]]
]);

why display dataProvider->sort?
if it disable we only can use:
```
$dataProvider = new ActiveDataProvider([
            'query' => BackendMenu::find()->orderBy(['sort' => SORT_ASC, 'id' => SORT_ASC]),
]);
````
but  usually we use in this way:
````
$dataProvider = new ActiveDataProvider([
            'query' => BackendMenu::find(),
            'sort' => ['defaultOrder' => ['sort' => SORT_ASC, 'id' => SORT_ASC]]
]);
````
@dkhlystov
Copy link
Owner

If do not do this, tree may be broken. It is more actual for moving nodes. What you see is not what you get.
I think it's possible with some conditions for parent related tree. I need to inspect code before.
With nested sets it does not matter, because first sorting by 'feft' attribute, which different for all nodes and used also for sorting.

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.

None yet

2 participants