Skip to content

bug(Table): 表单维护似乎还有Bug #7873

@BI7PRK

Description

@BI7PRK

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

BUG在 文档例子中,不能随意点项目的,每点一下,要关闭窗口再打开才能更点选

Image

Expected Behavior

public class SysMenuItem
{
    [AutoGenerateColumn(Ignore = true)]
    [Display(Name = "主键")]
    public int Id {  get; set; }

    [Required(ErrorMessage = "{0}不能为空")]
    [AutoGenerateColumn(Order = 1, Filterable = true, Searchable = true)]
    [Display(Name = "名称")]
    public string Name { get; set; } = string.Empty;


    [AutoGenerateColumn(Order = 2, ComponentType = typeof(Select<SelectedItem>))]
    [Display(Name = "归属")]
    public int Pid { get; set; } = 0;
}

以下模型中,Pid作为树型归属ID。在表格绑定

    <TableColumns>
        <TableColumn @bind-Field="@context.Pid" Items="@GetParent(context)" />
    </TableColumns>

症状:没有成功绑定数据。GetParent 方法是没有问题的

Image

那么如果将 public int Pid { get; set; } = 0; 改为 public IEnumerable<string> Pid { get; set; } 就成功显示数据。

但是,提交时。Pid 并没有值 = []

疑问:如何实现针对树状数据的模型进行归属项的维护绑定?

Interactive render mode

Interactive Server (Interactive server-side rendering (interactive SSR) using Blazor Server)

Steps To Reproduce

(https://www.blazor.zone/table/edit#InjectDataService

Exceptions (if any)

No response

.NET Version

NET9.0

Anything else?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions