So, i've got an action:
$query = MyModel::specificFind();
$data = new ActiveDataProvider([
'query' => $query,
'sort' => [
'enableMultiSort' => True,
],
'totalCount' => MyModel::specificCount()
]);
In view:
<?= GridView::widget([
'dataProvider' => $data,
'columns' => MyModel::allowedAttributes(),
]) ?>
SQL Query looks good:
SELECT * FROM `my_model_table` WHERE `specific_id`=42 GROUP BY `id` ORDER BY `my_field` DESC LIMIT 20;
It's 1st page with selected order by "my_field". So, data recieved from SQL is correct. But for some reason result shuffles every time i refresh my page (while all query and data are the same)!
However, it doesn't shuffle in chunk of data that have different values in sorting column. So, data with value "5" in sorting column will shuffle, data with "3", "4", "5" is behaving exactly like expected.