Unable to override browser status as explained in doc

12 posts, 0 answers
  1. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 26 Jul 2009 Link to this post

    Hello,
    I want to avoid displaying the navigateurl when mouse is over a menuitem (or RadPanelBarItem) and I try to use, as explained in doc the OnClientMouseOver and OnClientMouseOut
    client messages to trigger a javascript displying the menuItem Text as

    function OnClientMouseOver(panelbar, args)   
    {  
        window.status  =   args.get_item().get_text();   

    but it has no effect: still the href of anchor is displayed.
    Is there some security trick  or a bug in my code ? when I insert alert, I really get correct text.

    Notice that I think this should be an option for radMenu and RadPanelBar ?
    Thanks for help.


    CS
  2. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 27 Jul 2009 Link to this post

    Hi Christian,

    Please find below a sample code snippet that shows the needed approach.

    <form id="form1" runat="server"
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
        <telerik:RadMenu ID="RadMenu1" runat="server"
            <Items> 
                <telerik:RadMenuItem runat="server" Text="Root RadMenuItem1" NavigateUrl="Default.aspx"
                    <Items> 
                        <telerik:RadMenuItem runat="server" Text="Child RadMenuItem 1" NavigateUrl="Default.aspx"
                        </telerik:RadMenuItem> 
                        <telerik:RadMenuItem runat="server" Text="Child RadMenuItem 2" NavigateUrl="Default.aspx"
                        </telerik:RadMenuItem> 
                    </Items> 
                </telerik:RadMenuItem> 
            </Items> 
        </telerik:RadMenu> 
     
        <script type="text/javascript"
            $telerik.$('.rmLink').each(function(e) { 
                var text = $telerik.$(this).text(); 
                this.onmouseover = function() { window.status = text; return true; }; 
            }); 
        </script> 
     
        </form> 


    All the best,
    Paul
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 27 Jul 2009 Link to this post

    Hello Paul,

    Thanks but the code you send seems subject to Telerik changing a deep code value like rmLink

     $telerik.$('.rmLink').each(function(e) { 
                var text = $telerik.$(this).text(); 
                this.onmouseover = function() { window.status = text; return true; }; 
            }); 

    So thanks unless Telerik certify this value will not change in next years...

    Why my approach is not working ? I respected all Telerik documentation and sucessufully receive the text value as I could se with alert ?
    Problem seems to be in windows.status= 'something' in respect of browser version ?


    Thanks
    CS
  5. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 27 Jul 2009 Link to this post

    Hello Christian,

    We certify that we do not intend to change the rmLink class name in the foreseeable future. It is safe to use the code sample.

    The difference between the two approaches is that attaching the event through the OnClientMouseOver event, you do not cancel the browser-specific display of the links (e.g. the browser displays the href in the status bar, ignoring what you previously set in the handler).

    Sincerely yours,
    Alex
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 27 Jul 2009 Link to this post

    Hello Alex,

    So some thread on this subject has to be marked as obsoletes...

    Other problem, is this javascript working if I get several radmenus on the page ?

    Is add the attribute 'onmouseover' to my radmenuitems from codebehind a solution to avoid the javascript ?

    Thanks for answer

    CS
  7. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 27 Jul 2009 Link to this post

    Hello Christian Surieux,

    Could you please let us know where you found any references to window.status in our help? I tried looking in the documentation of RadMenu and RadPanelbar but I couldn't find any. We would like to update the help topic so it is not misleading other users.

    Yes you can use that javascript with more than one menu on the page. Additionally you can use the "onmouseover" attribute however it would generate more output in your page. We recommend using the JavaScript solution.

    Regards,
    Albert
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 27 Jul 2009 Link to this post

    Hello Albert,


    Sorry, I browsed in my history and was unable ti find the forum where somebody from Telerik has replyed by the code implying OnClientMouseOver and OnClientMouseOut
    and in the last documentation the OnclientMouveOver doesnt concern status but putting Menuitem text in a label.

    Concerning javascript I have to face the problem of very slow client pages due to tons of javascript, and long to load pages due to tons of code...


    Thanks
    CS
  9. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 28 Jul 2009 Link to this post

    Hello Paul or Alber,

    I am also trying to do this for RadPanelBar, I suppose that $telerik.$('.rmLink').each(function(e)  is only working for RadMenu? Is tehre something for RadPanelBar ?

    Thanks

    CS
  10. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 28 Jul 2009 Link to this post

    Hello Christian,

    Frankly, I don't think your request has anything to do with any Telerik control.

    The browser status bar is there to show status messages *from the browser*, not from the web page author. A web page is not the application, the browser is the application. The web page is the data.

    This has been thrashed about endlessly in the developers newsgroups lately. The general consensus is that, when viewers hover over a link they sometimes look at the status bar to see where the link is going to send them to. If something other than a URL appears then they get suspicious and just don't go there.

    In addition, the status bar manipulation is turned off by default (see attached screenshot), so the provided JS won't work.

    Still, please find below the modified code snippet that will work with RadPanelBar.

    <script type="text/javascript"
        $telerik.$('.rpLink').each(function(e) {  
            var text = $telerik.$(this).text();  
            this.onmouseover = function() { window.status = text; return true; };  
        });  
    </script>  


    Kind regards,
    Paul
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  11. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 28 Jul 2009 Link to this post

    Hello Paul,

    Thanks for all aspects of your answer.
    I would say that it's cunfortable to have power to do it.
    After we will decide what to do, but actually we use an url rewriter and even if the user is interested to see an url, it will not be the real thing.
    How people could be sure that the displayed url is the real href ?

    We prefer display the text of our menu, or better the tooltip message which is more detailled when existing.

    But your right there is certainly tons of pages on the subject everywhere, it was the same for MDI last century :)

    Personnaly I thing that browsers are reinventing the wheel, hundred of people have already spend time on UI, 3270 was quite good, Vax Messages and Wix very good :)

    Anyway thanks.

    CS
  12. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 28 Jul 2009 Link to this post

    Hello Paul,

    Last small request: .Text is for Text, and for tooltip text ?

    Thanks
  13. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 31 Jul 2009 Link to this post

    Hello Christian,

    Here it is:

     <script type="text/javascript">  
        $telerik.$('.rpLink').each(function(e) {   
            var text = $telerik.$(this).attr("title")
            this.onmouseover = function() { window.status = text; return true; };   
        });   
    </script> 


    Sincerely yours,
    Paul
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017