Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
865
To change imageurl in client side
posted

Hi,

    i have a tree where there are multiple parent and child node. if i click on a node, i want to change the image for that node in client-side. is there an option to change selected image url in client-side?  can someone tell me how to go abt it?

  • 2211
    posted

     

    You could try concatenating an image tag to the nodes text:

    <img src='Image/Location' alt='' width='24' height='24' border='0'> Node Text

    I would use client side node click event and then use the setText of the node.

    Something like:

        node.setText = "<img src='Image/Location' alt='' width='24' height='24' border='0'>" + node.getText;

    You might consider using some type of a global var or cookie to store the node id that has been clicked and then reference against the var/cookie to see if it's the same node that has been clicked and if it's not then strip the image tag from the text in the node with the id in the var/cookie and append the image tag to the new node clicked. Then set var/cookie to new node id that has been clicked.

    This is just an idea.

    Hope it helps,

    Patrick

     

    P.S. You can also check out this post: http://forums.infragistics.com/forums/t/3276.aspx