Skip to content

Commit

Permalink
fix rendering header and footer in case of using POS_ROWS_BEGIN in Ta…
Browse files Browse the repository at this point in the history
…bleRenderer
  • Loading branch information
unclead committed Apr 21, 2024
1 parent 21d0138 commit 7022e48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Yii2 multiple input change log

2.30.0 (in development)
=======================
- #363 fix rendering header and footer in case of using POS_ROWS_BEGIN in TableRenderer (unclead)

2.30.0
=======================
Expand Down
8 changes: 8 additions & 0 deletions src/renderers/TableRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ protected function internalRender()
public function renderHeader()
{
$cells = [];
if ($this->isAddButtonPositionRowBegin()) {
$cells[] = $this->renderButtonHeaderCell();
}

foreach ($this->columns as $column) {
/* @var $column BaseColumn */
$cells[] = $this->renderHeaderCell($column);
Expand Down Expand Up @@ -97,6 +101,10 @@ public function renderFooter()
$columnsCount++;
}

if ($this->isAddButtonPositionRowBegin()) {
$columnsCount++;
}

$cells = [];
$cells[] = Html::tag('td', ' ', ['colspan' => $columnsCount]);
$cells[] = Html::tag('td', $this->renderAddButton(), [
Expand Down

0 comments on commit 7022e48

Please sign in to comment.