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

Treeview left pane item click load right pane

6 Answers 115 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 05 May 2014, 09:29 PM
Hi,

I have a splitter with a treeview in one vertical pane on the left.  When a user clicks an item in the treeview, I would like to load items in horizontal panes in the center.  Is this possible?
thank you,

6 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 06 May 2014, 11:10 AM
Hello Patrick,

It is possible. Use the select treeview event to execute code when the user selects a node. Use the ajaxRequest splitter method to load content via AJAX in a given pane, or set the content of the pane directly via jQuery.fn.html.

Regards,
Alex Gyoshev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Patrick
Top achievements
Rank 1
answered on 06 May 2014, 03:09 PM
Thanks, I got that to work using the select method.  I also need to trigger a selected event on sub item clicks.  Each treeview node I have is three levels deep.  Is this also possible? I'm using the .BindTo method to bind the treeview
0
Alex Gyoshev
Telerik team
answered on 07 May 2014, 06:36 AM
Hello Patrick,

The select event is triggered when the TreeView selection changes, as shown in the events demo. Do you encounter a problem when using the BindTo method? If so, please provide a sample that shows this.

Regards,
Alex Gyoshev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Patrick
Top achievements
Rank 1
answered on 07 May 2014, 12:48 PM
Hi,  The bindto method is working fine.  I didn't realize that the click event occurred on item and sub item clicks.  Now I'm having the problem that the treeview loads very slow.  I set  .LoadOnDemand(true), but that doesn't seem to help.  All the sub items still seem to load initially.  Is there anything I can do here?

thanks
0
Patrick
Top achievements
Rank 1
answered on 07 May 2014, 01:33 PM
I tried setting the treeview to load ajax instead of using the bindto method, however this causes an error in kendo.all.min.js line 9:

TypeError: item.level is not a function



 @(Html.Kendo().TreeView()
                                        .Name("treeview")
                                        .HtmlAttributes(new { @class = "demo-section" })
                                        .DataTextField("Description")
                                           .Events(events => events
                                            //    .Expand("onExpand")
                                                .Select("Selected")
                                                )                                                                              
                                       .DataSource(dataSource => dataSource
                                            .Model(model => model                                              
                                                .Id("myfield")                                              
                                                .HasChildren("HasChildren")
                                            )
                                            .Read(read => read
                                                // The action method which will return JSON
                                                .Action("GetTreeProducts", "Home")
                                            )
                                        )                                       
                                 )



0
Alex Gyoshev
Telerik team
answered on 08 May 2014, 06:04 AM
Hello Patrick,

Since you created a separate thread for the TreeView issue and it deviates from the initial problem, I'm closing this thread.

Regards,
Alex Gyoshev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Splitter
Asked by
Patrick
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Patrick
Top achievements
Rank 1
Share this question
or