I use this sorting on the DataProvider for the CGridView:
'sort' => [ 'defaultOrder' => 'subscriber_count DESC', 'attributes' => [ 'subscriber_count' => [ 'desc' => 'subscriber_count ASC', 'asc' => 'subscriber_count DESC', ]
Yes, the sorting directions are inverted, no idea why but subscriber_count is a subquery with COUNT() and for some reason I had to invert them for the arrows to point on the correct direction
The sorting’s defaultOrder does work correctly, but shows no arrow, and if you click on the column header, the table shows again sorted Descending, but this time with the arrow, so if you want to sorting Ascending, you have to click twice from the first page load.
How should I do to get the arrow to show by default?