动态表的页脚值-角

问题描述 投票:0回答:1

从JAVA后端API,我得到此响应。

[
    [
        {
            "cardType": null,
            "cardDescText": "DISC      ",
            "dueToday": "1",
            "dueTomorrow": "0",
            "due2Days": "1",
            "due3Days": "0",
            "due4Days": "1",
            "due5Days": "11",
            "due6Days": "6",
            "due7Days": "1",
            "due8To15Days": "3",
            "due16PlusDays": "2",
            "total": "26",
            "msg": null,
            "tableName": null
        },
        {
            "cardType": null,
            "cardDescText": "Grand Total",
            "dueToday": "1",
            "dueTomorrow": "0",
            "due2Days": "1",
            "due3Days": "0",
            "due4Days": "1",
            "due5Days": "11",
            "due6Days": "6",
            "due7Days": "1",
            "due8To15Days": "3",
            "due16PlusDays": "2",
            "total": "26",
            "msg": null,
            "tableName": null
        }
    ]
]

我们已经在我们的项目中创建了一个动态席子表。因此,在上面的JSON数据中,无论哪里有“ cardDescText”:“ Grand Total”,我都希望将其保留在mat表的页脚中。

angular angular-material-6
1个回答
0
投票

您可以在表中为页脚创建一个单独的数据单元格,如下所示:

<td mat-footer-cell *matFooterCellDef> Grand Total </td>

看看这个stackblitz example

来自官方angular material documentation

© www.soinside.com 2019 - 2024. All rights reserved.