Prado\Web\UI\WebControls\TDataGrid::groupCells PHP 메소드

groupCells() 개인적인 메소드

Merges consecutive cells who have the same text.
부터: 3.1.1
private groupCells ( )
    private function groupCells()
    {
        if (($columns = $this->_allColumns) === null) {
            return;
        }
        $items = $this->getItems();
        foreach ($columns as $id => $column) {
            if (!$column->getEnableCellGrouping()) {
                continue;
            }
            $prevCell = null;
            $prevCellText = null;
            foreach ($items as $item) {
                $itemType = $item->getItemType();
                $cell = $item->getCells()->itemAt($id);
                if (!$cell->getVisible()) {
                    continue;
                }
                if ($itemType === TListItemType::Item || $itemType === TListItemType::AlternatingItem || $itemType === TListItemType::SelectedItem) {
                    if (($cellText = $this->getCellText($cell)) === '') {
                        $prevCell = null;
                        $prevCellText = null;
                        continue;
                    }
                    if ($prevCell === null || $prevCellText !== $cellText) {
                        $prevCell = $cell;
                        $prevCellText = $cellText;
                    } else {
                        if (($rowSpan = $prevCell->getRowSpan()) === 0) {
                            $rowSpan = 1;
                        }
                        $prevCell->setRowSpan($rowSpan + 1);
                        $cell->setVisible(false);
                    }
                }
            }
        }
    }