Skip to content

Fix table totals when column has a decorator - #2323

Open
officialasishkumar wants to merge 1 commit into
atk4:developfrom
officialasishkumar:fix_totals_with_decorator
Open

officialasishkumar wants to merge 1 commit into
atk4:developfrom
officialasishkumar:fix_totals_with_decorator

Conversation

@officialasishkumar

Copy link
Copy Markdown

fix #1799

Table::addDecorator() turns the Table::$columns entry into a list of column instances, but Table::getTotalsRowHtml() expected a single column. Any table combining a decorated column with addTotals() failed to render with Call to a member function getTag() on array, or with getTotalsCellHtml() when the totals plan aggregates that column.

The totals cell now uses the first formatter, the same way Table::getHeaderRowHtml() does for the header cell.

The new test decorates a column for each kind of totals cell (text, aggregate and no plan). It fails with the error above without the fix.

Table::addDecorator() turns the Table::$columns entry into a list of
column instances, but Table::getTotalsRowHtml() expected a single column.
Any table combining a decorated column with addTotals() failed to render
with "Call to a member function getTag() on array", or getTotalsCellHtml()
when the totals plan aggregated the decorated column.

Use the first formatter for the totals cell, the same way as
Table::getHeaderRowHtml() does for the header cell.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

addDecorator with tooltip not working on grids with addTotals line

1 participant