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

RadMenuItem set_imageUrl() does not display the image

7 Answers 151 Views
Menu
This is a migrated thread and some comments may be shown as answers.
calai
Top achievements
Rank 2
calai asked on 05 Dec 2008, 07:44 AM
Hello,

I added a new item in the radcontext menu using javascript, and this one works, but upon setting the image url of the new item added on the context menu, it does not display the image given the image url using the function set_imageUrl(string image url).

Hopefully you can help me with this problem.

Hope to hear from you soon.

Greetings,

~cLyde~

7 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 05 Dec 2008, 02:48 PM
Hi Clyde,

I am not able to replicate this issue at our side. Could you please paste a sample code here, so we can examine it? Thanks

Regards,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
calai
Top achievements
Rank 2
answered on 08 Dec 2008, 02:14 AM
  var nodeValue = node.get_value();
                     var nodeArray = nodeValue.split("*");
                     var newItem = new Telerik.Web.UI.RadMenuItem();
                     
                    if (nodeArray[2] == "2") // check if cat ID is image(2) then add new item for image as thumbnail
                    {
                       contextMenu.trackChanges();
                       newItem.set_imageUrl("~/Images/edit.gif");
                       newItem.set_text("Y");
                       contextMenu.get_items().insert(0,newItem);
                       contextMenu.commitChanges();
                    }

*here is my code in adding new item for my rad menu. I've set the image url but, it does not display the image at all.
Thank you in advance.*

Greetings,

~cLyde~

^_^


0
calai
Top achievements
Rank 2
answered on 09 Dec 2008, 10:56 AM
Hello Telerik Team,

I have already figured out why it does not display the image because it can't locate the image url i provided.
I have corrected the image url, and it already displays the image on the IE browser only, not in firefox.

Do you have any idea why is this so? It is because, I tried to copy the url and run it on the mozilla firefox browser, and it displays the image but when assigned to the rad menu item image url, it does not display at all.

Hope someone can help me here with this one. Any help will be greatly appreciated.

Thank you.

Greetings,

~cLyde~

^_^
0
Yana
Telerik team
answered on 09 Dec 2008, 11:53 AM
Hello Clyde,

Please try to set the image like this:

newItem.set_imageUrl("Images/edit.gif");  
 
without  "~" sign in the url and tell us how it goes.

Greetings,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
calai
Top achievements
Rank 2
answered on 10 Dec 2008, 02:21 AM
Hello Yana,

Thank you so much for your latest reply. It does work on both browsers IE and Firefox with out the tilde sign "~".

I have another scenario, I also used to assign on the set_imageUrl(), an UNC path.
   ie. //193.0.165.120/130/10.jpg
But it only displays the image on the IE browser not on the Firefox. Do you know the reason why it behaves like this?

Thank you.

Greetings,

~cLyde~

^_^
0
Atanas Korchev
Telerik team
answered on 10 Dec 2008, 10:02 AM
Hi clyde rose,

This seems to be a browser specific limitation. You can try instead of \\server\image.gif to use file://///server/image.gif

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jhonny
Top achievements
Rank 2
answered on 31 Jan 2014, 02:46 PM
Hi Yana, This is working well, Thanks.
Tags
Menu
Asked by
calai
Top achievements
Rank 2
Answers by
Yana
Telerik team
calai
Top achievements
Rank 2
Atanas Korchev
Telerik team
Jhonny
Top achievements
Rank 2
Share this question
or