Won't Fix
Last Updated: 08 Nov 2019 10:45 by ADMIN
Juan
Created on: 28 Jan 2019 18:43
Category: DropDownTree
Type: Bug Report
0
In DropDownTree, setting value is doubling the values

Hi,

I have a DropDownTree with checkboxes, like so:

                    $("#cbxWorkZones").kendoDropDownTree({
                        placeholder: "Select Work Zones...",
                        dataTextField: "name",
                        dataValueField: "id",
                        valuePrimitive: true,
                        checkboxes: true,
                        checkAll: true,
                        autoClose: false,
                        autoBind: false,
                        dataSource: data.workZones
                    });

 

I get an instance of it like so:

    var wz = $('#cbxWorkZones').data("kendoDropDownTree");

I evaluate value and get this: []  meaning, there are no values selected.

Then I set its value like so:

    wz.value(["8", "6"]);

After setting the values, I evaluate value again, and I get this: [8,6,8,6]

Why are the values duplicated?

Thanks!

Juan

 

2 comments
ADMIN
Ivan Danchev
Posted on: 08 Nov 2019 10:45

Hi,

We've revised this issue and updated the value API method documentation accordingly:
https://docs.telerik.com/kendo-ui/api/javascript/ui/dropdowntree/methods/value

The value duplication issue demonstrated with the example in the issue's description is due to passing the wrong type of values to the value method. The value field in the data is of type number, but we are setting the value by passing an array of strings to the method. To avoid this issue, pass an array of strings when the value field type is string, or an array of number when the value field type is number.

With the documentation updated accordingly and explaining the proper way to use the value method, we are closing this issue.

Regards,
Ivan Danchev
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.
ADMIN
Ivan Danchev
Posted on: 04 Feb 2019 15:43
Hi Juan,

Thank you for reporting this issue. We logged it for fixing. Our progress with fixing the bug will be reflected in the current item status.

I updated your Telerik points for reporting this bug.

Regards,
Ivan Danchev
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.