[CLOSED] Showing tool tip on the field label property of an ext control

  1. #1

    [CLOSED] Showing tool tip on the field label property of an ext control

    Hi Team,

    I have to display a tooltip on mouseover of a field label. Currently i am using field label property of a ext control. Field label is not a seperate control. Please find the code below:

    Ext.Net.Checkbox truefalse = new Ext.Net.Checkbox(containerPanel + "TrueFalse" + i);
    truefalse.ID = containerPanel + "TrueFalse" + i;
    truefalse.ExtraFieldLabel = customFieldLabel;
    truefalse.IsMandatory = customFields[i].IsMandatory;
    truefalse.IsVisible = customFields[i].IsVisible;
    truefalse.IsReadOnly = customFields[i].IsReadOnly;
    ToolTip tp = new ToolTip();
    tp.Html = customFields[i].ControlFieldLabel;
    tp.PaddingSummary= "0px 0px 0px 0px";
    truefalse.ToolTips.Add(tp);

    The above code displays tooltip on the entire control. But my requirement is to show tooltip only on the field label, where field label is just a property of the control
    Last edited by Daniil; May 21, 2013 at 3:39 AM. Reason: [CLOSED]
  2. #2
    Hi @MarginPoint,

    Welcome to the Ext.NET forums!

    Here is a solution.
    http://forums.ext.net/showthread.php?9465#post37555

    Example
    <ext:Checkbox ID="Checkbox1" runat="server" FieldLabel="FieldLabel">
        <ToolTips>
            <ext:ToolTip runat="server" Html="ToolTip" Target="#{Checkbox1}.label" />
        </ToolTips>
    </ext:Checkbox>
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @MarginPoint,

    Welcome to the Ext.NET forums!

    Here is a solution.
    http://forums.ext.net/showthread.php?9465#post37555

    Example
    <ext:Checkbox ID="Checkbox1" runat="server" FieldLabel="FieldLabel">
        <ToolTips>
            <ext:ToolTip runat="server" Html="ToolTip" Target="#{Checkbox1}.label" />
        </ToolTips>
    </ext:Checkbox>
    How can i achieve this using C# code as mentioned in my first post
  4. #4
    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Checkbox checkbox = new Checkbox();
                checkbox.ID = "Checkbox1";
                checkbox.FieldLabel = "FieldLabel";
                checkbox.ToolTips.Add(new ToolTip()
                    {
                        Html = "ToolTip",
                        Target = "#{Checkbox1}.label"
                    });
    
                this.Form.Controls.Add(checkbox);
            }
        }
    </script>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
        </form>
    </body>
    </html>

Similar Threads

  1. Replies: 1
    Last Post: Apr 19, 2012, 12:35 PM
  2. Replies: 2
    Last Post: Aug 19, 2011, 1:36 PM
  3. Replies: 4
    Last Post: Jul 29, 2011, 7:02 AM
  4. Replies: 3
    Last Post: Aug 04, 2010, 9:00 PM
  5. Replies: 4
    Last Post: Jun 25, 2010, 4:19 PM

Tags for this Thread

Posting Permissions