Telerik Forums
Kendo UI for jQuery Forum
1 answer
155 views

I have a kendo dropdown tree and when I set the datasource after initialization via .setDataSource([...]) it triggers the change event. How do I prevent this from happening? I am setting the datasource with a local javascript array of objects. I saw in another forum post to set the value to an empty array. I tried that but it still triggered the on change event. I'm doing this because I have 2 dropdowntrees (one in a flyout panel and one in the header) that I need to keep in sync.

Here is a dojo demonstrating my issue
https://dojo.telerik.com/iKoBOVIk/30

Nikolay
Telerik team
 answered on 21 Jul 2023
1 answer
162 views

Hello Team,

I have run the FastPass on the kendo control present at the below URL and found the a11y issues.

https://demos.telerik.com/kendo-ui/dropdowntree/checkboxes

https://demos.telerik.com/kendo-ui/dropdowntree/index

Please check the below images

On fixing one of the issues(adding aria-label attr) shown in the above image, new a11y issues are coming as shown in the below image. 

On fixing the above one as well, new a11y issues are coming,

Please let me know how can we fix this problem?

 

Thanks & Regards

Karan

Karan
Top achievements
Rank 1
 updated question on 04 Apr 2023
1 answer
162 views

I was trying to implement Kendodropdowntree , I came across following situation which I am not able to understand


                $(dropdowntree).kendoDropDownTree({
                placeholder: "Select ...",
                height: "auto",
                dataSource:  //HARD CODED VALUE GOES HERE 
            });
       } 

Above example will work fine when , I hard code those datasource values. When I try to pass some variable there it will not work

var datatobind= somedata // data in exact format it is expected 
{
        
                $(dropdowntree).kendoDropDownTree({
                placeholder: "Select ...",
                height: "auto",
                dataSource:  datatobind
            });
       }

Even I tried passing variable of following type

var dataSourcetype = new kendo.data.HierarchicalDataSource({
        data: datatobind
    });

 
{
        
                $(dropdowntree).kendoDropDownTree({
                placeholder: "Select ...",
                height: "auto",
                dataSource:  dataSourcetype.options.data
            });
       }

But even above also doesn't solve problem, I am not able to get it , why passing exact same variable is not binding to data source.

Lyuboslav
Telerik team
 answered on 14 Dec 2022
0 answers
85 views

When using the MVVM value binding with the DropDownTree, pressing the X button to clear the selection does not clear the bound field in the viewmodel.  If the DropDownTree is configured with valuePrimitive=true, then the VM bound field is completely unchanged  If the DropDownTree is configured with valuePrimitive=false, then the VM bound field is set to the string value of the prior selection's ID.

So my present workaround is to use valuePrimitive=false and if the VM bound field ends up being a string instead of an object, then treat it as null instead.  This adds a bunch of extra and ugly code to my app - is there any way to get the widget to simply set the bound VM field to null when the user clicks the X?

Bill
Top achievements
Rank 1
 updated question on 25 Nov 2022
1 answer
151 views

Hi,

I'm tryign to dynamically change the tagMode of a kendo.ui.DropDownTree as a user selects more or less items but the control does not refresh/rerender

 

Below is a sample of the code I have tried...

 var ddt = $(id).data('kendoDropDownTree');
        var maxSelectedItemsDisplayedInSingleTagMode = 3;
        let selectedValues = ddt.value();
        let currentTagMode = ddt.options.tagMode;
        let newTagMode = currentTagMode;

        newTagMode = selectedValues.length <= maxSelectedItemsDisplayedInSingleTagMode ? "multiple" : "single";
        if (newTagMode != currentTagMode) {
            ddt.value([])
            ddt.setOptions({
                tagMode: newTagMode
            });
            ddt.value(selectedValues);
        }

Something similar does work for the kendo.ui.MultiSelect but I cannot get it to play ball for kendo.ui.DropDownTree

 

Thanks

Neli
Telerik team
 answered on 28 Sep 2022
1 answer
473 views

Hello There,

I have a similar DropDownTree in my project.

I do not want to use clearButton, I would like to create a button with onClick clear out selected values and also the checkBox selection.

What I have tried: the used selectedIds= [] but on UI the tags stucked there, can not removed at all.

Thanks for your help!

Cheers,
Peter

Lyuboslav
Telerik team
 answered on 25 Jul 2022
0 answers
77 views
hi, i need use "aspnetmvc-ajax" in DropDownTree.dataSource but i got Error: "Uncaught TypeError: data.Data is undefined"
$("#dropdowntree").kendoDropDownTree({ 
     dataSource: { 
          type: "aspnetmvc-ajax", 
          transport: { 
              read: { url: "xxxxxxxxxxxxxxxxxxxxxxxxxxx" , data: forgeryToken, dataType: "json" }
 }}

thank you

vahid
Top achievements
Rank 2
Iron
Iron
Iron
 updated question on 01 Jun 2022
3 answers
527 views

Hello!

I wonder if there is a possibility to create an option ala "select all", but customize it to selecting only second-level nodes or nodes with specified ids?

Elisa
Top achievements
Rank 1
Iron
 answered on 25 May 2022
1 answer
74 views

I'm using a dropdowntree editor on a grid column. The bound field is a list of objects.

  • How would I prevent the top-level from getting selected when using check boxes with CheckAll true? I only want the second level items.
  • Conversely, how would I select the top level if any of the second level items are checked?

Ex. I would not want 18' checked here, just the two children on the 2nd level:

Editor:

function equipmentEditor(container, options) {
        let ds = new kendo.data.HierarchicalDataSource({
            data: _equipmentTypes,
            schema: {
                model: {
                    children: "Items"
                },
            },
        });

        $("<input data-bind='value: EquipmentTypes'/>")
            .attr("name", options.field)
            .appendTo(container)
            .kendoDropDownTree({
                checkboxes: {
                    checkChildren: true
                },
                checkAll: true,
                autoWidth: true,
                dataTextField: "Description",
                dataValueField: "Code",
                dataSource: ds,
                autoClose: false,
                tagMode: "single",
            });

_equipmentTypes data used in dataSource:

[
    {
        "Code": "17'",
        "Description": "17'",
        "Items": [
            {
                "Code": "T17.DUMP",
                "Description": "17' Dump Trailer",
                "Items": []
            }
        ]
    },
    {
        "Code": "18'",
        "Description": "18'",
        "Items": [
            {
                "Code": "T18.FLAT",
                "Description": "18' Flatbed Trailer",
                "Items": []
            },
            {
                "Code": "T18.TANK",
                "Description": "18' FoodGrade Tank Trailer",
                "Items": []
            }
        ]
    }
]

 

Posted object:

"EquipmentTypes": [
            {
                "Code": "17'",
                "Description": "17'",
                "Items": [
                    {
                        "Code": "T17.DUMP",
                        "Description": "17' Dump Trailer",
                        "Items": [],
                        "id": "",
                        "index": 0,
                        "checked": true,
                        "_level": 1,
                        "_tagUid": "b13353ee-cbd3-4226-8b4c-080d4ea775e4"
                    }
                ],
                "index": 0,
                "expanded": true,
                "checked": true,
                "_level": 0,
                "_tagUid": "c0785273-c8bd-4a18-8598-de5d7ba6c16e"
            },
            {
                "Code": "T17.DUMP",
                "Description": "17' Dump Trailer",
                "Items": [],
                "id": "",
                "index": 0,
                "checked": true,
                "_level": 1,
                "_tagUid": "b13353ee-cbd3-4226-8b4c-080d4ea775e4"
            }
        ],

   
Martin
Telerik team
 answered on 11 May 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?