Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞 - Table don't render column with unspecified template #2895

Closed
2 of 9 tasks
nsbarsukov opened this issue Oct 13, 2022 · 0 comments · Fixed by #2896
Closed
2 of 9 tasks

🐞 - Table don't render column with unspecified template #2895

nsbarsukov opened this issue Oct 13, 2022 · 0 comments · Fixed by #2896
Assignees

Comments

@nsbarsukov
Copy link
Member

Which @taiga-ui/* package(s) are the source of the bug?

addon-table

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/table-column-bug

Is this issue blocking you?

Non-Blocking

Description

Reproduction

Open https://stackblitz.com/edit/table-column-bug . It contains:

<table
    tuiTable
    class="table"
    [columns]="columns"
>
    <thead>
        <tr tuiThGroup>
            <th
                tuiTh
                [resizable]="true"
            >
                Name
            </th>
            <th tuiTh>Balance</th>
        </tr>
    </thead>
    <tbody
        tuiTbody
        [data]="data"
    >
        <tr
            *ngFor="let item of data"
            tuiTr
        >
            <!-- no column "Name" definition -->
            <td
                *tuiCell="'balance'"
                tuiTd
            >
                {{ item.balance | tuiFormatNumber }}
            </td>
        </tr>
    </tbody>
</table>

Expected behavior

Column "Balance" is generated via template marked with *tuiCell="'balance'".
Column "Name" is generated by these lines:
https://github.com/Tinkoff/taiga-ui/blob/65d5756e4ccaa0ae9547308d1add0fd1e2dd83e4/projects/addon-table/components/table/tr/tr.template.html#L6-L13

Screenshot 2022-10-13 at 16 20 10

Actual behavior

Screenshot 2022-10-13 at 16 24 51

It fails because this.body.rows.toArray() on this line
https://github.com/Tinkoff/taiga-ui/blob/65d5756e4ccaa0ae9547308d1add0fd1e2dd83e4/projects/addon-table/components/table/tr/tr.component.ts#L42
always return empty array :(

TBody-component can't query rows here:
https://github.com/Tinkoff/taiga-ui/blob/65d5756e4ccaa0ae9547308d1add0fd1e2dd83e4/projects/addon-table/components/table/tbody/tbody.component.ts#L48-L49

Angular version

any

Taiga UI version

3.6.0

Which browsers have you used?

  • Chrome
  • Firefox
  • Safari
  • Edge

Which operating systems have you used?

  • macOS
  • Windows
  • Linux
  • iOS
  • Android
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants