Skip to content

多语言: 数字类型字段在编辑对话框渲染为数字输入框格式问题 #4982

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

You must be logged in to vote

最终执行方案:

弄了个通用处理方法, 表格组件创建列的时候检查条件, 动态设置为对应的类型


    /// <summary>
    /// 获得/设置 列创建时渲染带小数格式字段为文本框组件, 默认 true
    /// </summary>
    [Parameter]
    [NotNull]
    public bool AutoRenderComponentWithLocaleFormat { get; set; } = true;


        if (AutoRenderComponentWithLocaleFormat && OnColumnCreating == null)
        {
            OnColumnCreating += AutoRenderComponentLocaleFormat;
        }

    /// <summary>
    /// 实现自动渲染组件类型
    /// </summary>
    /// <param name="columns"></param>
    /// <returns></returns>
    public static Task AutoRenderComponentLocaleFormat(List<ITableColumn> columns)
    {
        //经浏览器语言设定验证不过关,最终版本采用全部渲染为文本框解决问题
        //if (NumberDecimalSeparator == ".")
 …

Replies: 2 comments 1 reply

Comment options

densen2014
Dec 28, 2024
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by ArgoZhang
Comment options

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

densen2014 Dec 29, 2024
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants