Expand Collapse RadTree Node

3 posts, 0 answers
  1. Shree
    Shree avatar
    4 posts
    Member since:
    Aug 2014

    Posted 07 Aug 2014 Link to this post

    Hi All

    when user on mouseover of the +/- icons i need to Expand/Collapse tree nodes at client side.


    Thanks
    Sree
  2. Aneliya Petkova
    Admin
    Aneliya Petkova avatar
    207 posts

    Posted 08 Aug 2014 Link to this post

    Hi,

    Please try the following JavaScript code:
    var $ = $telerik.$;
     
    function pageLoad() {
        var treeView = $find("<%=RadTreeView1.ClientID %>").get_element();
        var rtMinus = $(treeView).find('.rtMinus');
        var rtPlus = $(treeView).find('.rtPlus');
     
        rtMinus.on("mouseover", function myfunction(e) {
            this.click();
        });
     
        rtPlus.on("mouseover", function myfunction(e) {
            this.click();
        });
    }

    I made you a video, showing how this custom code works at my side.

    Hope this would be helpful.

    Regards,
    Aneliya Petkova
    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 Ajax is Ready for VS 2017
  4. Shree
    Shree avatar
    4 posts
    Member since:
    Aug 2014

    Posted 11 Aug 2014 in reply to Aneliya Petkova Link to this post

    Thanks for your prompt response Aneliya. The code helped me.

    since i am getting script error with rtminus.on i have replce the same with rtminus.mouseover as below.

    rtMinus.mouseover(function myfunction(e) {
                this.click();
            });
         
            rtPlus.mouseover(function myfunction(e) {
                this.click();
            });
Back to Top