RadMenuItem set_imageUrl() does not display the image

8 posts, 0 answers
  1. calai
    calai avatar
    10 posts
    Member since:
    Oct 2008

    Posted 05 Dec 2008 Link to this post

    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~
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 05 Dec 2008 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. calai
    calai avatar
    10 posts
    Member since:
    Oct 2008

    Posted 07 Dec 2008 Link to this post

      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~

    ^_^


  5. calai
    calai avatar
    10 posts
    Member since:
    Oct 2008

    Posted 09 Dec 2008 Link to this post

    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~

    ^_^
  6. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 09 Dec 2008 Link to this post

    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.
  7. calai
    calai avatar
    10 posts
    Member since:
    Oct 2008

    Posted 09 Dec 2008 Link to this post

    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~

    ^_^
  8. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 10 Dec 2008 Link to this post

    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.
  9. Jhonny
    Jhonny avatar
    5 posts
    Member since:
    Nov 2013

    Posted 31 Jan 2014 in reply to Yana Link to this post

    Hi Yana, This is working well, Thanks.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017