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

Need some help with sourcing data from a remote source and handling duplicated items and indicating that there are more results.

6 Answers 68 Views
DropDownTree
This is a migrated thread and some comments may be shown as answers.
iCognition
Top achievements
Rank 1
iCognition asked on 14 Nov 2019, 12:00 AM

I have managed to get the searching to work with our existing systems however i have noticed that if items with the same "Value" are returned at different levels. For example, if i am looking for people by their username/name so if i have a person named "sysadmin" who is also part of a group called "Administrators" they are returned at two different levels within the tree and selecting both of them results in the selection appearing multiple times within the textbox. Is there some way that i can link these two (or more) items?

 

The other problem i am having is that when data is fetched from the server, we also provide an indicator that there are more matched results that are not returned in the search (because we are only displaying the first 20). The total number of matched results is returned as part of the response.

e.g.

{
  "Data": [/* 20 items */],
  "Total": 223
}

 

In our other dropdownlist selectors we use virtual scrolling to continuously fetch more results and in our grid and list view pages we use paging.

Is there some way that i can indicate to a user that there are more items that could have been returned but weren't? Either by including some sort of paging functionality or appending an indicator of some kind to the item list.

6 Answers, 1 is accepted

Sort by
0
iCognition
Top achievements
Rank 1
answered on 14 Nov 2019, 11:52 PM
After doing some more digging within the databound event I can see when the root of the tree is not showing all of the elements based on the information within the json response, however I cannot find anything to do something similar with each of the child nodes.
0
Plamen
Telerik team
answered on 15 Nov 2019, 12:03 PM

Hi,

Straight to the points:

DropDownTree component is designed to work with unique values for all its items so having the same values among some of its items will lead to unexpected behavior that is why such scenarios are currently not supported.

As for the indicator that you need you could use the footer template as for example it is done in this documentation article.

Regarding the last issue with the dataBound event - it is not quite clear so would you please elaborate a little bit what is not working correctly and what are you trying to achieve so we could think of a possible solution.

Regards,
Plamen
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.
0
iCognition
Top achievements
Rank 1
answered on 18 Nov 2019, 12:40 AM

Hi Plamen,

The footer template solves part of my problem and i can use it to show a button to increase the size of the page being returned. However it appears to only work for the main list of items and not the contents of other items. 

If i expand a group and the number of items shown is less than the total number on the server, i am unsure how i could indicate to the user that not all of the contents are being shown. 

Optimally i would like to append a message to the sub-tree to tell the user that not all items are being shown.

 

Thanks,

 

0
Plamen
Telerik team
answered on 19 Nov 2019, 12:27 PM

Hello,

There is not such template for the sub nodes in the treeview. Please excuse us for this limitation of the widget.

If you have further questions please let me know.

Regards,
Plamen
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.
0
iCognition
Top achievements
Rank 1
answered on 19 Nov 2019, 10:59 PM

I do notice that there is a databound event triggered when I expand a node to view its children, presumably because the datasource is doing another read. Is there an easy way for me to identify which node in the tree was responsible for the databound event? If so that would also solve my problem.

0
Plamen
Telerik team
answered on 20 Nov 2019, 02:29 PM

Hi,

You can use the e.sender.dataItem(e.node) in the dataBound event as for example it is done here - https://dojo.telerik.com/@zdravkov/utovILoF

Regards,
Plamen
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.
Tags
DropDownTree
Asked by
iCognition
Top achievements
Rank 1
Answers by
iCognition
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or