VIKAS KUMAR THAKUR
VIKAS KUMAR THAKUR

Reputation: 39

How can we hide zero value from text box if field type is number in kendo-ui?

I have a field with Project Code and type as a number but while rendering in the browser it shows default value as 0. So how should I hide or remove zero?

I am new to Kendo-UI. So I am not getting any idea.

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" }
                    }
                }
            }

Here in the above coa de, there is "Project_Code" field which has type as number but on browser the default value it render is zero. So, how to hide/remove default value zero for "Project_Code" field.

Upvotes: 2

Views: 424

Answers (1)

VIKAS KUMAR THAKUR
VIKAS KUMAR THAKUR

Reputation: 39

I found the answer after some searching.Just you need add nullable as true. Please find below re-framed code of mine.

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" }
                    }
                }
            }

Upvotes: 1

Related Questions