A
A
akula222017-02-21 11:25:57
Yii
akula22, 2017-02-21 11:25:57

How to display gridview grouped by field?

There is such a base

| id | total | group |
+---+------+-------+
|  1 |   1    |       1  |  
|  2 |   2    |       2  |    
|  3 |   0    |       1  |    
|  4 |   5    |       2  |

I need to display the gridview so that it groups the tables by the group field
and sorts each table by the total field,
I need to get such an output
группа1
    данные с полем group=1
    данные с полем group=1
группа2
     данные с полем group=2
     данные с полем group=2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2017-02-21
@slo_nik

Good morning.
Group $dateProvider first, and then give it to the widget or see this grid

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question