1. #1
    Ext User
    Join Date
    Oct 2010
    Posts
    11
    Vote Rating
    0
    caspar.jespersen is on a distinguished road

      0  

    Default Tooltip with dynamic content

    Tooltip with dynamic content


    Hello,

    I'm modifying a web solution, which is based on Ext JS 3.3.0.
    What I wanna do now, is to create an Ext Tooltip on a number of elements.

    I want to make this easy for myself, so I was thinking something like - all the elements I want to have a tooltip on, should have a selector (ie. class "tooltip-active") and an attribute with the tooltip value.

    I've been messing around a lot, but I can't seem to find the correct solution. At the moment, this is my code.

    Code:
    var mainTooltip = new Ext.ToolTip({
       target:Ext.select('.tooltip'),
       width:200,
       html: 'Test',
    });
    
    Ext.getBody().addListener("mouseover", function(event, target){
    	// code to modify tooltip value based on the attribute
    });
    1) My selector in the tooltip seems to be wrong, however, I have never developed in Ext before so maybe you guys can help me out on the smartest solution for this one?

    2) I made some code to check if the tooltip attribute is set, if so, changing the DOM. I noticed, however, that changing the DOM won't update the HTML content - is there any easy way to fix this?

    Thanks in advance!
    Caspar
    Last edited by caspar.jespersen; 18 Oct 2010 at 4:48 AM. Reason: Wrapped code with CODE-tags

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    94
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    I suggest having a look at how Animal's DataTip user extension does this.

Similar Threads

  1. Dynamic Content in dynamic tab panel
    By Dark Assassin in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 19 Apr 2010, 4:13 AM
  2. Dynamic tooltip
    By frankthetank in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 27 Nov 2008, 3:25 AM
  3. Tooltip content
    By Remy in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 23 Apr 2008, 1:36 PM

Thread Participants: 1

Tags for this Thread