protected function checkGroupedRow($model, $nextModel, $key, $index)
{
$endCol = 0;
foreach ($this->getVisibleColumns() as $column) {
/**
* @var Column $column
*/
$value = $column->content === null ? method_exists($column, 'getDataCellValue') ? $this->formatter->format($column->getDataCellValue($model, $key, $index), 'raw') : $column->renderDataCell($model, $key, $index) : call_user_func($column->content, $model, $key, $index, $column);
$nextValue = $column->content === null ? method_exists($column, 'getDataCellValue') ? $this->formatter->format($column->getDataCellValue($nextModel, $key, $index), 'raw') : $column->renderDataCell($nextModel, $key, $index) : call_user_func($column->content, $nextModel, $key, $index, $column);
if (isset($this->_groupedColumn[$endCol]) && !is_null($this->_groupedColumn[$endCol])) {
if (is_null($this->_groupedColumn[$endCol]['value'])) {
$this->_groupedColumn[$endCol]['value'] = $value;
$this->_groupedColumn[$endCol]['firstLine'] = $index;
}
if ($this->_groupedColumn[$endCol]['value'] != $nextValue) {
$groupFooter = isset($column->groupFooter) ? $column->groupFooter : null;
if ($groupFooter instanceof Closure) {
$groupFooter = call_user_func($groupFooter, $model, $key, $index, $this);
}
if (isset($groupFooter['content'])) {
$this->generateGroupedRow($groupFooter['content'], $endCol);
}
$this->_groupedColumn[$endCol]['firstLine'] = $index;
}
$this->_groupedColumn[$endCol]['value'] = $nextValue;
}
$endCol++;
}
}