I have a treeview with three hierarchy which has checkboxes along with them. I need to move only those data for which checkbox is checked to another treeview.
refer the dojo here;
http://dojo.telerik.com/eGINo/2
Can anybody let me know any idea to achieve this?
1 Answer, 1 is accepted
0
Ivan Zhekov
Telerik team
answered on 20 Dec 2016, 08:31 AM
While it's easy to iterate over a treeview and get the checked children, reconstructing the treeview might be challenging:
Kendo TreeView does not keep active track of checked items. Instead, they are pushed as a flat list to the server whenever you perform post request.
If we want to actually build a treeview i.e. a nested structure, how do we guarantee that we have it? And I will elaborate.
What if I select the inner most node (say item with index 1.5.6.10). What should be copied over? Just the node?
Then I select it's parent (1.5.6). When the treeview is updated do we show the parent / child relation?
Then I select a new end node (1.2.1.11). How do we show that? do we show it at the same level as 1.5.6? Because if we do, it will not be an accurate representation.
If we are to complicate the "show checkbox" logic, say dont show it on the top level and on the 3 and then 5th and so on and so forth, how do we construct the tree then?
To sum up, showing the checked items is quite easy -- just iterate over the datasource, as shown in the article I've sent you. Displaying them in a nested fashion is hard or next to impossible due to various customization options.