Change Image/Class of Node without roundtrip

3 posts, 1 answers
  1. shahab
    shahab avatar
    22 posts
    Member since:
    Oct 2012

    Posted 25 Sep 2008 Link to this post

    Hi could anyone please guide me in the direction of how I can implement the following:
    I am replacing the image of the node  by using the following code. but for some reason I cannot get the image changed. The text of the node changes correctly but the image is not working.

    //when the node is edites  
     
    function OnNodeEdited(nodetext,imageurl)   
     
    {  
     
    var tree = $find("<%= tvwUserWorkout.ClientID %>");  
     
    tree.trackChanges();  
     
    for (var i = 0; i < tree.get_nodes().get_count(); i++) {  
     
    var node = tree.get_nodes().getNode(i);  
     
    node.set_imageUrl(imageurl);  
     
    node.set_text(nodetext);  
     
     
    }  
     
    tree.commitChanges();  
     
    }  
     

    many thanks

  2. Answer
    Yana
    Admin
    Yana avatar
    4275 posts
    Member since:
    Sep 2012

    Posted 25 Sep 2008 Link to this post

    Hello Shahab,

    I tested the provided code and wasn't able to reproduce the issue you're facing. Please check the attached sample project for a reference. What is different in your case?

    Regards,
    Yana
    the Telerik team


    Check out Telerik Trainer, the state of the art learning tool for Telerik products.

  3. shahab
    shahab avatar
    22 posts
    Member since:
    Oct 2012

    Posted 25 Sep 2008 Link to this post

    It works perfectly now. many thanks again for your efficient support. have a great day.

Back to Top