E
E
Elios2015-10-28 14:48:50
Yii
Elios, 2015-10-28 14:48:50

How to group output in GridView Yii2?

This is what my GridView looks like

<?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],
            [
                'attribute' => 'group_id',
                'value' => function ($model) {
                    return empty($model->group_id) ? '-' : $model->group->group_name;
                },
            ],
            'word_name',
        ],
]); ?>

I wanted the Group 1 cell here to be aligned with the Group 1 cell below
df0555a68fbf40edadd087d6eada8ef2.JPG

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Mishko_kun, 2015-10-28
@Mishko_kun

Docs: demos.krajee.com/grid#grid-grouping
Demo: demos.krajee.com/group-grid

I
IvanFF, 2013-05-12
@IvanFF

1. Touchscreen in laptops is not convenient. Indulge in a couple of days and forget
2. Putting Linux on a poppy is many times easier than poppy on Lenova
3. It's a macbook and in 10 years it's a macbook. And what is Lenova X1 - Lenova herself will forget in half a year
. And draw your own conclusions :)

A
Antares19, 2013-05-12
@Antares19

When I thought about X1, I did not take it because I needed maximum power + operating time. Took T430s and upgraded to the maximum.
Although, of course, I want such compactness as the Carbon (I travel a lot, with a minimum of things and the laptop occupies a noticeable part of the backpack).

P
Piskov, 2013-05-13
@Piskov

Take poppy :-). True, it may be better to lower the frequency (performance, in fact, will be almost the same, but the battery will last longer). Well, maybe 256 is enough for your eyes (everything you don't need is online or on an external drive).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question