Skip to content

feat(ListView): 添加分组排序回调 #3683

Answered by ArgoZhang
densen2014 asked this question in Q&A
Discussion options

You must be logged in to vote

定义分组类

record ProductGroupKey
{
    public int PrintGroup { get; set; }

    public string Category { get; set; } = "";

    public override string ToString()
    {
        return $"{PrintGroup}-{Category}";
    }
}

定义分组回调参数

GroupName="p => new ProductGroupKey() { PrintGroup = p.PrintGroup, Category = p.Category }"

<ListView TItem="Product" GroupName="p => new ProductGroupKey() { PrintGroup = p.PrintGroup, Category = p.Category }" GroupOrderCallback="GroupOrderCallback" GroupItemOrderCallback="GroupItemOrderCallback" OnQueryAsync="@OnQueryAsync">
    <BodyTemplate>
        <Card>
            <BodyTemplate>
                <div class="lv-demo-desc">@context.Category</div>
            </Bo…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

densen2014
Jun 19, 2024
Collaborator Author

You must be logged in to vote
1 reply
@ArgoZhang
Comment options

Answer selected by densen2014
Comment options

densen2014
Jun 19, 2024
Collaborator Author

You must be logged in to vote
0 replies
Comment options

densen2014
Jun 19, 2024
Collaborator Author

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request
2 participants
Converted from issue

This discussion was converted from issue #3656 on June 19, 2024 00:33.