This is a migrated thread and some comments may be shown as answers.

DropDownTree with HierarchicalDataSource and serverFiltering causes selected items to freeze...

6 Answers 225 Views
DropDownTree
This is a migrated thread and some comments may be shown as answers.
Boris
Top achievements
Rank 1
Boris asked on 23 Mar 2020, 04:58 PM

Hello everyone,

if I use a HierarchicalDataSource with serverFiltering set to true, filter requests are being sent to my remote data source. The problem is though, that already selected items can not be removed any more by clicking on the delete icon after the dataSource has been reloaded, probably due to changed uid's. Is there a workaround for this?

Bye,

Bo

6 Answers, 1 is accepted

Sort by
0
Boris
Top achievements
Rank 1
answered on 24 Mar 2020, 05:15 PM

Some code toreproduce:

<!DOCTYPE html>
<html>
<head>
    <base href="https://demos.telerik.com/kendo-ui/dropdowntree/remote-data-binding">
    <style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style>
    <title></title>
    <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2020.1.219/styles/kendo.material-v2.min.css" />

    <script src="https://kendo.cdn.telerik.com/2020.1.219/js/jquery.min.js"></script>
   
   
    <script src="https://kendo.cdn.telerik.com/2020.1.219/js/kendo.all.min.js"></script>
   

</head>
<body>
        <div id="example">
            <div class="demo-section k-content">
                <input id="dropdowntree" style="width: 100%;" />
            </div>
            <script>
                var serviceRoot = "https://demos.telerik.com/kendo-ui/service";
                    homogeneous = new kendo.data.HierarchicalDataSource({
                       serverFiltering: true,
                        transport: {
                            read: {
                                url: serviceRoot + "/Employees",
                                dataType: "jsonp"
                            }
                        },
                        schema: {
                            model: {
                                id: "EmployeeId",
                                hasChildren: "HasEmployees"
                            }
                        }
                    });

                $("#dropdowntree").kendoDropDownTree({
                    placeholder: "Select ...",
                    dataSource: homogeneous,
                    height: "auto",
                    filter: "contains",
                    clearButton: false,
                    checkboxes: true,
                    autoClose: false,
                    dataTextField: "FullName"
                });
            </script>
        </div>
</body>
</html>

0
Petar
Telerik team
answered on 25 Mar 2020, 04:10 PM

Hi Bo,

The example you've sent uses as a basis this Binding to remote data example. The server configuration of this demo doesn't have the server filtering functionality implemented. If you test the provided code, you will see that remote service is always returning the same items no matter what is entered in the DropDownTree filter input.

If you continue to experience the reported behavior, I would need a runnable example in which the discussed unexpected behavior can be replicated. Thus I can test the project and provide relevant feedback about what could be source of the issue. 

Regards,
Petar
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Boris
Top achievements
Rank 1
answered on 25 Mar 2020, 04:30 PM

Hi Petar,

thank you for answering. I am well aware that the data source is always returning the same items, but this is not the issue i was going to adress. The problem is, as described in my opening post, that already selected data items get screwed after the data source has been reloaded due to filtering. To replicate this behaviour, the given code will suffice. Please try the following steps:

- opening the widget and select an entry, f. ex. "Janet Leverling"

- click in the filter text box and type something, f. ex. "test"

After the data source has been reloaded, you can select Janet again, having two selected Janets with the first one not being removable any more. My guess is, that this may have something to do with Kendo's internal UID's, but so far I have not found a way to circumvent this bug.

Thanks in advance,

Boris

 

 

0
Petar
Telerik team
answered on 27 Mar 2020, 02:12 PM

Hi Boris,

I've misled you with my previous response.

The DropDownTree doesn't have the server-filtering option implemented yet. If you want to filter component's items you will have to fetch all data locally. This is how the component currently works.

I saw that you've already found and voted for the DropDownTree Server Filtering feature request. Based on the community interest in it and our priority queue, we might consider its implementation in the future. I cannot say if and when this will happen.  

Let me know if you have any questions related to the current thread.

Regards,
Petar
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Boris
Top achievements
Rank 1
answered on 01 Apr 2020, 12:49 PM

Hi Petar,

thanks again for your answer and efforts. If possible, I would like to give some more info on this for you to forward to your development team. ;-)

(1) Official or not, server filtering does already work. At least in the sense that filtering parameters are actually being send to the remote data source. The problem is that after the data source has been reloaded, previously selected items are still being rendered but not recognized any more. This leads to the problems mentioned above such as inability to remove items from the multiselect field via UI or the ability to reselect already selected items.

(2) IMPORTANT! These effects *also* seem to occur when the hierarchical data source is being reloaded for other reasons such as a triggered load event or a custom reload button. Reloading a data source should not break a valid selection of previously checked items in a dropDownTree. I still suspect that there is a problem with Kendo's internal UID's and the fact that those don't match any more after a dataSource has been reloaded. Is this a bug? Maybe there is a workaround for this?

(3) And finally, please allow me to submit this heart warming plea for a more wholesome dropDownTree widget. Hierarchis are a powerful tool to handle large amounts of data in an ergonomic way and a lot of data is even hierarchical by nature: locations, products and ware groups, teams/departments in a company... The list goes on. I believe that no one will deny that a working dropDownTree should be a staple of any modern UI framework and is surely more important than the n-th implementation of a new management chart. Still, Kendo's dropDownTree still lacks a few more touches to be really usable. Here is what I would wish for:

- single and multi select modes for item selection
- ability to send selected values on form submit to the controller as any input widget does
- working on local as well as remote data sources and with optional server filtering
- ability to load the whole data source at once when load on demand is set to false (currently returning a full tree still causes Kendo to make single requests for each node even if their children were included in the original GET request)

Parts of this have already been implemented so why not go the whole nine yards? ;-)

Regards,

Boris

 

0
Petar
Telerik team
answered on 03 Apr 2020, 12:17 PM

Hi Boris,

Thank you for your structured and well-reasoned post about the DropDownTree component's functionalities. At the beginning of the next week, I will discuss your thoughts with the team. For sure, some of the shared here functionalities will be considered when we decide to implement additional features to the DropDownTree. When this will happen? It all depends on the community's interest in the different components' features. 

Regarding point two from your reply, can you edit this Demo in a way the reported behavior will be replicated? Send me a Dojo with the edited version and I will discuss the issue with my colleagues - if it is a bug or expected behavior. 

Regards,
Petar
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
DropDownTree
Asked by
Boris
Top achievements
Rank 1
Answers by
Boris
Top achievements
Rank 1
Petar
Telerik team
Share this question
or