Treeview left pane item click load right pane

7 posts, 0 answers
  1. Patrick
    Patrick avatar
    20 posts
    Member since:
    Aug 2013

    Posted 05 May 2014 Link to this post

    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,
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 06 May 2014 Link to this post

    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.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Patrick
    Patrick avatar
    20 posts
    Member since:
    Aug 2013

    Posted 06 May 2014 in reply to Alex Gyoshev Link to this post

    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
  5. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 07 May 2014 Link to this post

    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.

     
  6. Patrick
    Patrick avatar
    20 posts
    Member since:
    Aug 2013

    Posted 07 May 2014 in reply to Alex Gyoshev Link to this post

    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
  7. Patrick
    Patrick avatar
    20 posts
    Member since:
    Aug 2013

    Posted 07 May 2014 in reply to Patrick Link to this post

    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")
                                                )
                                            )                                       
                                     )



  8. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 08 May 2014 Link to this post

    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.

     
Back to Top
UI for ASP.NET MVC is VS 2017 Ready