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

Kendo treeview expand UI overlapping icons

3 Answers 221 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Ratan
Top achievements
Rank 1
Ratan asked on 24 Dec 2019, 11:36 AM

I have a Kendo UI treeview which contains some node that i load children on expand by firing a ajax call and returning a data array. This works fine and i get the data and it binds to the tree.
However the issue occurs after the first expand of a node, when i expand the node first time the tree behaves correctly and everything is fine, however if i collapse and expand the node again the tree does not push the other nodes down and the expanded node overlaps all other icons in tree.

Here is the code that i use to build the tree

01.$('#all-library-tree').kendoTreeView({
02.            loadOnDemand: true,
03.            dataSource: _masterTreeViewMasterObj.sort().reverse(),
04.            expand: function (e) {
05.                var treeView = $('#all-library-tree').data('kendoTreeView');
06.                var dataItem = treeView.dataItem(e.node);
07.                dataItem.load();
08. 
09.                if (dataItem.children.data().length !== 0) return;
10. 
11. 
12.                if (dataItem.id === -1) {
13.                    //get unused data
14.                    GetUnUsedChildrenForRHSTree(dataItem.text, dataItem.children);
15.                }
16. 
17.            }
18.        });

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 26 Dec 2019, 07:20 AM

Hello Ratan,

I will need additional information in order to troubleshoot the issue. More specifically, the code responsible for adding the new TreeView nodes, as well as the custom CSS overrides. Therefore, may I ask you to provide a runnable Dojo example where the described issue could be observed ? The following example could be used as a starting point:

Regards,
Dimitar
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
Ratan
Top achievements
Rank 1
answered on 26 Dec 2019, 10:12 AM

Hi Dimitar,

Thank you for your reply, but i was able to fix this issue, i added dataItem.loaded("false") and then added dataItem.load(); not really sure what the cause of the behavior was but that line of code i added fixed my issue.

Also, i do not have any additional code. that is all that i have. and no addition CSS. 

0
Dimitar
Telerik team
answered on 27 Dec 2019, 07:32 AM

Hi Ratan,

In general, when the loaded() method is executed on a node it is marked as loaded and further requests will not be made. Therefore, calling the method again as loaded(false) resets the flag and allows the node to be reloaded. I assume that this was the main cause for the issue.

Regards,
Dimitar
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
TreeView
Asked by
Ratan
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Ratan
Top achievements
Rank 1
Share this question
or