Declined
Last Updated: 04 Feb 2022 08:53 by ADMIN
Mark
Created on: 18 Jun 2021 11:44
Category: Form
Type: Bug Report
1
DatePicker is rendered in the Form when the string could be evaluated as Date

Bug report

When a string that could be evaluated as a Date is used in the Form, a DatePicker is rendered instead of TextBox

Reproduction of the problem

  1. Open the Dojo linked here

Current behavior

The fromData for the first field is set as string 'TextBox1: "12/11/1969"', however, the '12/11/1969' could be evaluated as a Date. Thus, the From displays a DatePicker although the field is not explicitly casted to Date.

Expected/desired behavior

When the value is not explicitly set as a Date a TextBox should be rendered in the Form.

Workaround

var MyModel = kendo.data.Model.define({
              fields: {
                  "TextBox1": {
                      type: "string"
                  },
                  "TextBox2": {
                      type: "string"
                  }
              }
          });

Dojo

Environment

  • Kendo UI version: 2021.2.616
  • Browser: [all]
1 comment
ADMIN
Veselin Tsvetanov
Posted on: 04 Feb 2022 08:52

Hi Mark,

The automatic recognition of a Date string as a Date value is indeed expected. The logic is implemented so that the Form would automatically identify such values as Dates and will use the applicable default editor. Disabling that functionality will introduce a regression for all users that rely on it.

Regards,
Veselin Tsvetanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.