Tooltip not showing on first mouseover

  1. #1

    Tooltip not showing on first mouseover

    Hi Ext.net team,

    I want to display ToolTip when mouseover event occur.
    The tooltip won't show up when I move mouse over at the first time,
    but it does show up when I move mouse over from the second time.
    Please take a look of the source code and attachment for further information.

    Click image for larger version. 

Name:	2014-05-26-ToolTip.png 
Views:	40 
Size:	11.8 KB 
ID:	11441
    <%@ Page Language="C#" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
    
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script type="text/javascript">
            var ShowTip = function (obj, targetid) {
                var msg = "" + Ext.getCmp(targetid).getRawValue();
                if (msg != "") {
                    obj.body.dom.innerHTML = Ext.String.format("{0}", msg);
                }
                else
                    obj.hide();
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager runat="server" Namespace="" />
        <ext:ComboBox ID="cmbTest" runat="server" FieldLabel="Item"
            TypeAhead="false" Width="190" HideBaseTrigger="false" MinChars="1" LabelWidth="60" MatchFieldWidth="false">
            <Items>
                <ext:ListItem Text="A" />
                <ext:ListItem Text="B" />
                <ext:ListItem Text="C" />
            </Items>
            <ToolTips>                            
                <ext:ToolTip ID="ToolTip3" runat="server" Width="280">
                    <Listeners>
                        <Show Handler="ShowTip(this, 'cmbTest')" />
                    </Listeners>
                </ext:ToolTip>
            </ToolTips>
        </ext:ComboBox>
        </form>
    </body>
    </html>

    Any advice?
    Thanks
    Last edited by capbarbell; May 27, 2014 at 6:06 AM.
  2. #2
    Quote Originally Posted by capbarbell View Post
    Hi Ext.net team,

    I want to display ToolTip when mouseover event occur.
    The tooltip won't show up when I move mouse over at the first time,
    but it does show up when I move mouse over from the second time.
    Please take a look of the source code and attachment for further information.

    Click image for larger version. 

Name:	2014-05-26-ToolTip.png 
Views:	40 
Size:	11.8 KB 
ID:	11441
    <%@ Page Language="C#" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
    
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script type="text/javascript">
            var ShowTip = function (obj, targetid) {
                var msg = "" + Ext.getCmp(targetid).getRawValue();
                if (msg != "") {
                    obj.body.dom.innerHTML = Ext.String.format("{0}", msg);
                }
                else
                    obj.hide();
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager runat="server" Namespace="" />
        <ext:ComboBox ID="cmbTest" runat="server" FieldLabel="Item"
            TypeAhead="false" Width="190" HideBaseTrigger="false" MinChars="1" LabelWidth="60" MatchFieldWidth="false">
            <Items>
                <ext:ListItem Text="A" />
                <ext:ListItem Text="B" />
                <ext:ListItem Text="C" />
            </Items>
            <ToolTips>                            
                <ext:ToolTip ID="ToolTip3" runat="server" Width="280">
                    <Listeners>
                        <Show Handler="ShowTip(this, 'cmbTest')" />
                    </Listeners>
                </ext:ToolTip>
            </ToolTips>
        </ext:ComboBox>
        </form>
    </body>
    </html>

    Any advice?
    Thanks

    Hey, it's been a while. Is there anybody can help me deal with this problem.
    I'll be really appreciate. Thanks
  3. #3
    you can change the value of tooltip by the value changed listener of combox cotrol, why any time you want show the toltip you change them ?
  4. #4
    this is a work arround solution, i hope that is usefull



    X.ComboBox().ID("Combo").ToolTips(tips => tips.Add(X.ToolTip().ID("t")))
                    .Listeners(listeners => listeners.Change.Handler = @"
    
    var msg = #{Combo}.getValue();
    
    
    #{t}.setTitle(msg);
    
    ")
                    .Items(
                        X.ListItem().Text("a").Index(1),
                        X.ListItem().Text("b").Index(2)
                    )
  5. #5
    Quote Originally Posted by othmanee View Post
    this is a work arround solution, i hope that is usefull



    X.ComboBox().ID("Combo").ToolTips(tips => tips.Add(X.ToolTip().ID("t")))
                    .Listeners(listeners => listeners.Change.Handler = @"
    
    var msg = #{Combo}.getValue();
    
    
    #{t}.setTitle(msg);
    
    ")
                    .Items(
                        X.ListItem().Text("a").Index(1),
                        X.ListItem().Text("b").Index(2)
                    )
    Thanks for your feedback.
    About tooltip issue, if I assign tooltip MinHeight, the tooltip will show up correctly.
    Buy what I really need is the tooltip can display in its optimal height.

Similar Threads

  1. window opacity on mouseover
    By retto in forum 2.x Help
    Replies: 1
    Last Post: Mar 30, 2014, 10:48 PM
  2. Replies: 0
    Last Post: May 11, 2012, 9:02 PM
  3. Replies: 1
    Last Post: Nov 30, 2011, 4:10 PM
  4. Replies: 6
    Last Post: May 25, 2010, 9:53 AM
  5. [CLOSED] GridPanel MouseOver
    By harafeh in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 13, 2009, 3:18 PM

Posting Permissions