Kendo-ui-core: When using `for` attribute in a NumericTextbox or DatePicker/DateTimePicker TagHelper the `format` property is not serialized

Created on 7 Mar 2018  路  4Comments  路  Source: telerik/kendo-ui-core

Bug report

When using for attribute in a NumericTextbox or DatePicker/DateTimePicker TagHelper the format property is not serialized.

Reproduction of the problem.

The issue could be reproduced with the following configuration:

<kendo-numerictextbox for="ID" format="n0" decimals="0" min="1" max="9999" />

The above configuration evaluates to the following:

kendo.syncReady(function(){jQuery("#ID").kendoNumericTextBox({"decimals":0});});

Workaround

As a workaround use the name attribute.

Environment

  • Kendo UI version: 2018.1.221
  • jQuery version: x.y
  • Browser: [all]
Bug DatePicker DateTimePicker NumericTextBox TimePicker Priority 1 Wrappers (ASP.NET Core) Medium jQuery1

All 4 comments

It is hard to say if the for attribute that specifies the ModelExpression should have higher or lower priority than the format attribute.
In case the for is specified, the format from the EditFormatString metadata is used. In the example above it is probably not set, so nothing is serialized.

This is the original code: https://github.com/telerik/kendo/commit/d1c8c25994b5648e4327a8886bc1348e5eb6528b , made on purpose and it is not a bug, my suggestion is that the documentation should be extended.

I guess that maybe it should be have lower priority than the format configuration option. At least in this case user is able to override the EditFormatString metadata if needed using the configuration option.

Seems like the format property should be used in this case, then fallback to the format metadata.

In this case, we should correct it for the DatePickers as well.

Was this page helpful?
0 / 5 - 0 ratings