[CLOSED] need to put a Tooltip on panel title

Page 2 of 3 FirstFirst 123 LastLast
  1. #11
    Quote Originally Posted by geoffrey.mcgill View Post
    I believe the following string is not correct in your code sample:

    "panChart.ClientID.header.getEl()"
    panChart.ClientID should be C# concatenated to a string.

    Please review the sample posted above by @daniil.
    Yes, I see, but the point is that boh tooltip AND panel are code behind created, so I couldn't use an Ext object as in the example, because it simply didn't exist as a javascript object and coul't be accessed (I have a javascript error if I try)

    The Target property has been fixed in the 2.1 branch.
    I will try on monday. I hope that I will not be stop with same problem above.
  2. #12
    Quote Originally Posted by feanor91 View Post
    Yes, I see, but the point is that boh tooltip AND panel are code behind created, so I couldn't use an Ext object as in the example, because it simply didn't exist as a javascript object and coul't be accessed (I have a javascript error if I try)
    Then you can attach a target for the ToolTip within a Panel AfterRender listener using the setTarget method.
    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.tip.ToolTip-method-setTarget
  3. #13
    Yes, this is a very good idea. Thanks
  4. #14
    Hello

    Basicaly it works but I still have a problem. I cannot create the tooltip associated to the panel. I work in vb and not in C# and all I try to create my tooltip conduct to an undefined object in JS. Here the code I use to create my tooltip (in the same time as the panel):

    Dim ChartTip As New Ext.Net.ToolTip
            ChartTip.ID = "tip" + ChartsToDraw
            ChartTip.AutoHide = "false"
            ChartTip.Closable = "true"
            ChartTip.Draggable = "true"
            ChartTip.Html = "Click the X to close tip on pan" + ChartsToDraw
    
            MyPanel.Controls.Add(ChartTip)
    I think problem is on the last line. I try, Me.Controls.Add(ChartTip), MyWindows.Controls.Add(ChartTip) (I have a window definition just above to add the panel to), but nothing works. In the same time, I will try to work on a simple example in VB to look for.

    Edit:

    It works. I render the tip to the window: here the code of the function:

       <DirectMethod(ShowMask:=True, Msg:="Server is building charts, please wait")> Public Sub BuildPanelByDirectMethod(ByVal Title As String, ByVal Left As Double, ByVal Top As Double, ByVal ChartsToDraw As String, ByVal Width As Double, ByVal Height As Double)
            Userparameters = GlobalFunction.ReadUserDataFromCookie(Request.Cookies("User"))
            Dim INT_idRmdEntity As Integer = Userparameters.idRmdEntities
    
            Dim myWindow As Ext.Net.Window = MyDesktop.Modules("Dashboard").Window(0)
            Dim MyPanel As New Ext.Net.Panel
            Dim myChart As New Ext.Net.Chart
    
            Dim ChartTip As New Ext.Net.ToolTip
            ChartTip.ID = "tip" + ChartsToDraw
            ChartTip.AutoHide = "false"
            ChartTip.Closable = "true"
            ChartTip.Draggable = "true"
            ChartTip.Html = "Click the X to close tip on pan" + ChartsToDraw
    
            ChartTip.Render(myWindow)
    
            myChart = BuildChart(ChartsToDraw, False)
    
            MyPanel.ID = "pan" + ChartsToDraw
            MyPanel.Title = Title
            MyPanel.Layout = "Fit"
            MyPanel.Height = CType(Height, Integer)
            MyPanel.Width = CType(Width, Integer)
            MyPanel.X = CType(Left, Integer)
            MyPanel.Y = CType(Top, Integer)
    
            MyPanel.Listeners.AfterRender.Handler = "ShowPanelTip('" + MyPanel.ID + "', '" + ChartTip.ID + "');"
    
            MyPanel.Items.Add(myChart)
    
            MyPanel.Render(myWindow)
    
       End Sub
    and in the javasscript call after panel is rendered:
    var ShowPanelTip = function (pan, tip)
    {
        Ext.getCmp(tip).setTarget(Ext.getCmp(pan).header.getEl());
    }
  5. #15
    Use Tooltips collection instead Controls
    MyPanel.Tooltips.Add(ChartTip)
  6. #16
    I tried last week, but fail, as I understand in Sencha forum about the tooltip collection, it seems related to the tools option, but I may be wrong.
  7. #17
    No, not Tools collection, Tooltips is different collection
  8. #18
    OK, now I know it work in the way I find, I will retry, if I understand well, it will simply change the way the tooltip will be added to the dom right? And if so, what is the advantage in the front of my solution?
  9. #19
    Placing the ToolTip into the ToolTips collection will cause this ToolTip to be rendered automatically.

    Generally, your solution is good as well. Just it looks more organized with the ToolTips collection.
  10. #20
    Hi,

    It works for with the tooltips collection too. In fact, in my previous try, I rest on the problem I was not able to set tatget to the tooltip.

    However I have a question: what is the purpose of the tooltip collection? can we have more than one tooltip on an object? And change the tolotip use depending of the context at run time? if yes, could be interesting....
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. [CLOSED] [#72] Title in Tab panel truncated in IE8 for ver2.1
    By CarpFisher in forum 2.x Legacy Premium Help
    Replies: 15
    Last Post: Sep 30, 2013, 4:19 PM
  2. [CLOSED] Dynamic Panel Title
    By pint in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 23, 2012, 6:25 AM
  3. Title of Panel with FormGroup=true
    By wdk in forum 1.x Help
    Replies: 6
    Last Post: Mar 23, 2012, 4:29 PM
  4. [CLOSED] Collapsed Panel Title
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 27, 2009, 1:03 PM
  5. Panel - Collapsed Title?
    By Tbaseflug in forum 1.x Help
    Replies: 5
    Last Post: Jan 21, 2009, 9:35 AM

Posting Permissions