shirong xiu
shirong xiu

Reputation: 1

Yii2 how to merge two/more rows in one column with GridView

How can I merge two or more rows in one column with GridView in Yii2? The screenshot for 'ETSv2':

enter image description here

Thanks in advance

Upvotes: 0

Views: 1872

Answers (1)

Muhammad Shahzad
Muhammad Shahzad

Reputation: 9652

In your model:

public function getMergedRows()
{
   return $this->name . ' \n ' . $this->eamil;
}

in your grid view:

[
    'label'=>'Test',
    'attribute'=>'MergedRows',
],

Upvotes: 1

Related Questions