gpt4 book ai didi

kendo-ui - 如何为 Kendo 网格设置初始分组

转载 作者:行者123 更新时间:2023-12-03 19:52:07 24 4
gpt4 key购买 nike

因此,我使用 Kendo Grid 在服务器端获得了以下代码片段。但是,我对下一步感到困惑。

如何将网格设置为最初按 Income_Party 分组?也可以在每个分组中添加总金额吗?

@(Html.Kendo().Grid(Model.IncomeView)
.Name("grid")
.Columns(columns =>
{
columns.Bound(model => model.INC_INCOME_DESCRIPTION);
columns.Bound(item => item.INC_INCOME_AMOUNT);
columns.Bound(item => item.INC_INCOME_PARTY);
columns.Template(@<text>
@Html.ActionLink("Edit", "Edit", "MyLink" + item.VIEW_TYPE, new { id = item.GID, ReturnAction = "IncomeAndExpenses" }, null)
</text>)
.ClientTemplate("<a href='/brunch/statistics/brunchid=#= BrunchCode#'>#=BrunchCode#</a>")
.Title("");
})

)

最佳答案

您可以像这样设置初始组和聚合:

@(Html.Kendo().Grid(Model.IncomeView)
.Name("grid")
.Columns(columns =>
{
columns.Bound(model => model.INC_INCOME_DESCRIPTION);
columns.Bound(item => item.INC_INCOME_AMOUNT).GroupFooterTemplate(@<text>
Total: @item.Sum
</text>);
columns.Bound(item => item.INC_INCOME_PARTY);
columns.Template(@<text>
@Html.ActionLink("Edit", "Edit", "MyLink" + item.VIEW_TYPE, new { id = item.GID, ReturnAction = "IncomeAndExpenses" }, null)
</text>)
.ClientTemplate("<a href='/brunch/statistics/brunchid=#= BrunchCode#'>#=BrunchCode#</a>")
.Title("");
})
.DataSource(dataSource => dataSource
.Server()
.Aggregates(aggregates =>
{
aggregates.Add(p => p.INC_INCOME_AMOUNT).Sum();
})
.Group(groups => groups.Add(p => p.INC_INCOME_PARTY))
)

关于kendo-ui - 如何为 Kendo 网格设置初始分组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25162705/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com