Completed
Last Updated: 06 Oct 2020 14:11 by ADMIN
Release 2020.R1.SP1
Devon
Created on: 04 Oct 2019 14:41
Category: Filter
Type: Bug Report
0
Filter Control: 'Default Value' on 'number' type field will not accept 0 (zero)

When using the Filter control and configuring the Fields, if a 'number' type field is used, the value 0 (zero) is ignored, for example:


$("#filter").kendoFilter({
    dataSource: dataSource,
    expressionPreview: true,
    fields: [
      { name: "age", type:"number", defaultValue: 31 },
      {name: "foo", type: "number", defaultValue: 0},
      { name: "name", type:"string", defaultValue: "Rick" }
    ]
  });

'age' and 'foo' are both 'number' type fields, but the default value of 'foo' will be ignored when the filter is chosen in the UI.

 

Here is a runnable example of this, notice how when selecting 'age' from the fields dropdown, the value correctly defaults to 31, but selecting the 'foo' field will not have the value populate correctly:

https://dojo.telerik.com/eHAROSOz

2 comments
ADMIN
Viktor Tachev
Posted on: 11 Oct 2019 11:26

Hi Devon,

 

Thank you for reporting the behavior to us. The developers will look into it as soon as possible. 

As a token of gratitude for bringing the issue to our attention I have updated your Telerik points.

 

Regards,
Viktor Tachev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Devon
Posted on: 10 Oct 2019 17:55

I have found that the issue also extends to boolean values and specifying a default value of "false"

My guess is that the values of "0" and "false" aren't being interpreted as a flag to indicate if there is a default value, and not what the default value actually is.

 

I've included a separate dojo that illustrates this, I apologize for my incorrect link from earlier.

Notice how the two boolean fields both have default values, but only the "true" value appears in the expression preview.

https://dojo.telerik.com/@dsmith/oMOloCAW