Commit d825b745 by Carsten Brandt

added note about default order

fixes #4042
parent f871a047
...@@ -387,6 +387,13 @@ $query->andFilterWhere(['LIKE', 'author.name', $this->getAttribute('author.name' ...@@ -387,6 +387,13 @@ $query->andFilterWhere(['LIKE', 'author.name', $this->getAttribute('author.name'
> 'desc' => ['au.name' => SORT_DESC], > 'desc' => ['au.name' => SORT_DESC],
> ]; > ];
> ``` > ```
>
> Also when specifying the [[yii\data\Sort::defaultOrder|defaultOrder]] for sorting you need to use the relation name
> instead of the alias:
>
> ```php
> $dataProvider->sort->defaultOrder = ['author.name' => SORT_ASC];
> ```
> Info: For more information on `joinWith` and the queries performed in the background, check the > Info: For more information on `joinWith` and the queries performed in the background, check the
> [active record docs on eager and lazy loading](active-record.md#lazy-and-eager-loading). > [active record docs on eager and lazy loading](active-record.md#lazy-and-eager-loading).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment