window onmouseover

4 posts, 0 answers
  1. Nik
    Nik avatar
    51 posts
    Member since:
    Sep 2009

    Posted 21 Jul 2010 Link to this post

    Can I get some assistance with getting a radwindow to pop-up like a tooltip on mouseover of an element? I'm a little confused as to how to start it. The window also needs to have pre-defined text instead of loading a separate page into the window.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 Jul 2010 Link to this post

    Hello,

    I am not sure about your scenario, but you can use client method to open the RadWindow in the onmouseover event of the element. The following documentation shows how to open window from client side.
    Opening Windows

    And you can use the <ContentTemplate> section of RadWindow to place predefined text in window.


    -Shinu.
  3. Nik
    Nik avatar
    51 posts
    Member since:
    Sep 2009

    Posted 22 Jul 2010 Link to this post

    I managed to get the window to open, but getting it to close onmouseout isn't working. Using the same close code I've used before, but it throws a JS error saying object required. An alert showed it did get into the close function, but not into the if statement. ideas?

    if (window.frameElement) {
            GetRadWindow().close();
        }
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 23 Jul 2010 Link to this post

    Hello,

    Check out the following code snippet which shows how to open/close RadWindow in 'OnMouseOver'/'OnMouseOut' event of RadTextBox. I hope you will find it very useful.

    ASPX:
    <telerik:RadWindow ID="RadWindow1" runat="server">
      <ContentTemplate>
          <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
      </ContentTemplate>
    </telerik:RadWindow>
    <telerik:RadTextBox ID="RadTextBox1" runat="server">
         <ClientEvents OnMouseOver="OnMouseOver" OnMouseOut="OnMouseOut" />
    </telerik:RadTextBox>

    Java Script:
    <script type="text/javascript">
        function OnMouseOver() {
            var oWnd = $find("<%=RadWindow1.ClientID%>");
            oWnd.show();
        }
        function OnMouseOut() {
            var oWnd = $find("<%=RadWindow1.ClientID%>");
            oWnd.close();
        }
    </script>

    Regards,
    Shinu.
Back to Top