Telerik Forums
Kendo UI for jQuery Forum
7 answers
916 views

I have been playing around with the new DropDownnTree component (which I love btw) but found that there isn't a "clear" event so I have to use the "change" event which the clear button triggers. The problem is that the value is not reset before triggering this event therefore I can't use it to check if the change event was fired by the clear button.

Dojo: https://dojo.telerik.com/UNIdEjEH

<div id="example">
    <div class="demo-section k-content">
        <h4>Select an item</h4>
        <input id="dropdowntree" style="width: 100%;" />
    </div>
    <script>
        $(document).ready(function () {
 
            // create kendoDropDownTree from input HTML element
            $("#dropdowntree").kendoDropDownTree({
                placeholder: "Select ...",
                height: "auto",
                dataSource: [
                    {
                        text: "Furniture", expanded: true, items: [
                            { text: "Tables & Chairs" },
                            { text: "Sofas" },
                            { text: "Occasional Furniture" }
                        ]
                    },
                    {
                        text: "Decor", items: [
                            { text: "Bed Linen" },
                            { text: "Curtains & Blinds" },
                            { text: "Carpets" }
                        ]
                    }
                ]
              , change: function(e) {
                kendo.alert("Value: " + this.text());
              }
            });
        });
    </script>
</div>

I would think either resetting the component before triggering the change button or adding a clear event is needed.

Thanks.

John
Top achievements
Rank 1
Iron
 answered on 10 Apr 2024
1 answer
11 views

I have a DropDownTree on my site. When the text of the item is too long to fit I am seeing a horizontal scrollbar and the gray colored background does not expand. I don't want auto width as that makes the container grow larger than the input control is. How can I instead have it wrap? 

Neli
Telerik team
 answered on 27 Mar 2024
1 answer
21 views

I have a kendo dropdown tree with a selected value that was there on initialization. When the user clicks on the dropdown for the first time, I want the list to auto expand the selected node so the user can see it the child item. How do I do this? 

Similarly, I would like the user to be able to click on a parent node and, instead of selecting the parent node, since that isn't allowed in my case, it should just expand so they can see the children. 

Neli
Telerik team
 answered on 27 Mar 2024
1 answer
14 views

My requirement is similar to this question "How to reset the scroll position in a Kendo Dialog (jquery) in Kendo UI for jQuery | Telerik Forums"Reset Scroll Position in Kendo Dialog jQuery

My only requirement is to reset the scroll position of the dropdown whenever a button is clicked. Currently, when I reopen the dropdown, it remembers the last scroll position. I want this position to be reset whenever the user performs an action, such as clicking a button.

Neli
Telerik team
 answered on 26 Mar 2024
1 answer
192 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
172 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
182 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
97 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
161 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
506 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?