【问题标题】:How can we hide zero value from text box if field type is number in kendo-ui?如果字段类型是 kendo-ui 中的数字,我们如何从文本框中隐藏零值?
【发布时间】:2019-01-14 11:30:10
【问题描述】:

我有一个带有项目代码的字段并输入为数字,但在浏览器中呈现时它显示默认值为 0。那么我应该如何隐藏或删除零?

我是 Kendo-UI 的新手。所以我没有任何想法。

schema: {
                data: "data", total: "total",
                model: {
                    id: "id",
                    fields: {
                        SBU: { type: "string" },
                        Project_Code: { type: "number" },
                        Role: { type: "string" },
                        IPM_Oracle_UserID: { type: "string" },
                        IQ_LoginID: { type: "string" }
                    }
                }
            }

在上面的代码中,有一个“Project_Code”字段,其类型为数字,但在浏览器上它呈现的默认值为零。那么,如何隐藏/删除“Project_Code”字段的默认值为零。

【问题讨论】:

    标签: kendo-ui


    【解决方案1】:

    经过一番搜索,我找到了答案。只需将 nullable 添加为 true。请在下面找到我的重新构建的代码。

    schema: {
                    data: "data", total: "total",
                    model: {
                        id: "id",
                        fields: {
                            SBU: { type: "string" },
                            Project_Code: { type: "number", nullable: true },
                            Role: { type: "string" },
                            IPM_Oracle_UserID: { type: "string" },
                            IQ_LoginID: { type: "string" }
                        }
                    }
                }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-03
      • 1970-01-01
      • 1970-01-01
      • 2015-03-26
      • 2013-04-06
      • 1970-01-01
      • 2014-06-23
      • 1970-01-01
      相关资源
      最近更新 更多