A
A
Acvoloe2018-06-27 07:16:05
Yii
Acvoloe, 2018-06-27 07:16:05

How to sort by array in GridView?

Good afternoon!
There is a GridView with data and it is necessary to display the data in a certain sequence, i.e. there is an array with id records and it is necessary to sort in this order
$sort = [221, 342, 11, 523]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-06-27
@webinar

It is necessary to pass the required query to the dataProvider, here is an example query:
Order by Case sorting algorithm in SQL

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question