raddock on screen center

4 posts, 0 answers
  1. james
    james avatar
    26 posts
    Member since:
    Jan 2007

    Posted 06 Jun 2008 Link to this post

    How can I show raddock in the middle of user screen?

    Regrads

    J
  2. Baatezu
    Baatezu avatar
    110 posts
    Member since:
    Aug 2007

    Posted 09 Jun 2008 Link to this post

    I hadn't tried to do that yet, but I decided now would be a good time.
    I tried
    function ShowHideRadDock1() 
            { 
                var wide = window.screen.availWidth; 
                var high = window.screen.availHeight; 
                var dock = $find('<%= RadDock1.ClientID %>'); 
     
                var isClosed = dock.get_closed(); 
                dock.set_closed(false); 
                 
                dock.set_top(high/2 - dock.get_heigth()); 
                dock.set_left(wide/2 - dock.get_width()); 
            } 
    and everything SAYS it worked, but my dock never moves.
    In firefox you can execute javascript from the address bar (not sure if IE does that) so I have been testing and double checking the functions listed at http://www.telerik.com/help/aspnet-ajax/dock_clientraddock.html and some of them didn't work, specifically set_left, set_top, set_title.
    They pretend to work. If I run the get versions of those functions from the address bar, I get the values I used in the set. If I don't set anything, then I get the values that I have set at design time.
    Other functions, set_closed(), set_collapsed, work.
    I haven't tested everything, but these 5 are kinda critical to client side manipulation of floating docks. ( my dock is floating, it returns 1 when I check).

    Should I open a ticket to get these issues addressed?

    EDIT - The javascript in address bar does work in IE - but appears to behave the same as in FF.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. james
    james avatar
    26 posts
    Member since:
    Jan 2007

    Posted 09 Jun 2008 Link to this post

    Try this. This work in my case:

            function BrowseImport(sender) 
            {       
                var dockImport = $find("<%= RadDockImport.ClientID %>");                         
                var dockStyle = document.getElementById("<%= RadDockImport.ClientID %>");   
             
                var left = (screen.width - dockImport.get_width().replace("px","")) / 2; 
                var top  = (screen.height - dockImport.get_height().replace("px","")) / 2;             
     

                dockStyle.style.left = left + "px";       
                dockStyle.style.top = top + "px";       
                dockImport.set_closed(false); 
                importButton = sender
                return false; 
            }    

  5. james
    james avatar
    26 posts
    Member since:
    Jan 2007

    Posted 09 Jun 2008 Link to this post

    Try this. This work in my case:

            function BrowseImport(sender) 
            {       
                var dockImport = $find("<%= RadDockImport.ClientID %>");                         
                var dockStyle = document.getElementById("<%= RadDockImport.ClientID %>");   
             
                var left = (screen.width - dockImport.get_width().replace("px","")) / 2; 
                var top  = (screen.height - dockImport.get_height().replace("px","")) / 2;             
     

                dockStyle.style.left = left + "px";       
                dockStyle.style.top = top + "px";       
                dockImport.set_closed(false); 
                importButton = sender
                return false; 
            }    

Back to Top