imageURL not persisted on postback

2 posts, 0 answers
  1. Steve
    Steve avatar
    1885 posts
    Member since:
    Dec 2008

    Posted 06 Sep 2010 Link to this post

    Here's my code to make new nodes

    function addApproverClick() {
            var window = $find("<%= newTabWindow.ClientID %>");
            var tree = $find("<%= treeView.ClientID %>");
            window.close();
     
            tree.trackChanges();
            var node = new Telerik.Web.UI.RadTreeNode();
            node.set_text('test');
            node.set_value(getPickerOptions());
            node.set_imageUrl("../images/person-white.png");
     
            selectedNode.expand();
            if (addType == "Add") {
                selectedNode.get_parent().get_nodes().add(node);
            } else {
                selectedNode.get_nodes().add(node);
            }
            tree.commitChanges();
        }

    So it all works, great when I click a button on the page to postback, all the nodes created clientside are missing that image.

    It seems that it's appending the Host to the beginning of it instead of what I assigned it.
    http://postgrad.dev.medportal.ca/apps/rto/new/images/person-white.png

    ..weird?
  2. Yana
    Admin
    Yana avatar
    4881 posts

    Posted 08 Sep 2010 Link to this post

    Hello Steve,

    Please avoid using relative urls (with ../) when they're set on the client.  If the url is set like this:

    node.set_imageUrl("images/person-white.png");

    the image will be shown as expected after postback.

    Best wishes,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top