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

imageURL not persisted on postback

1 Answer 38 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 07 Sep 2010, 04:59 AM
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?

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 08 Sep 2010, 01:41 PM
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
Tags
TreeView
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Yana
Telerik team
Share this question
or