Jump to content

UniCalendar Panel Event Hint


TNT23

Recommended Posts

I am using the code bellow to display hints when the mouse is over an event... The problem i'm having is that the hint is displayed the second time the mouse goes over the event. I searched the net and i found that the problem is because i create the tooltip inside the eventover .... Is there a workaround???

function eventover(sender, rec, el, eOpts)
{
  var pop_content =  "<div id='popup-data'><p><b>Details: </b>" +rec.data.Notes.replace(/\n/g, "<br />")+"</p></div>";
  new Ext.ToolTip({
   target: el
   ,title: rec.data.Title
   ,dismissDelay: 2000 // auto hide after 2 seconds
   ,anchor: 'top'
   ,anchorOffset: 85
   ,trackMouse: true
   ,renderTo: Ext.getBody()
   ,html: pop_content
   }).show;
}


Link to comment
Share on other sites

I found the answer .... Add the code bellow to CalendarPanel.ExtEvents.eventsrendered

function eventsrendered(sender, eOpts)
{           var curView = sender;
            var evtElements = Ext.select('.ext-cal-evt', true);
            if (evtElements)
            {
                //Loop through all elements
                Ext.each(evtElements.elements, function(eachEl) {
                    //Get EventId from from elment
                    var evtId = curView.getEventIdFromEl(eachEl);
                    var rec = sender.getEventRecord(evtId);
                    if (!Ext.isEmpty(rec))
                    if (!Ext.isEmpty(evtId)){
                        var pop_content =  "<div id='popup-data'><p><b>Details: </b>" +rec.data.Notes.replace(/\n/g, "<br />")+"</p></div>";
                          new Ext.ToolTip({
                           target: eachEl
                           ,title: rec.data.Title
                           ,dismissDelay: 2000 // auto hide after 2 seconds
                           ,anchor: 'top'
                           ,anchorOffset: 85
                           ,trackMouse: true
                           ,html: pop_content
                          });  

           
                    }
                }, this);
            }
}
  • Upvote 1
Link to comment
Share on other sites

  • 4 weeks later...

:)

 

Code to Pascal, good luck!

 

 

  UniCalendarioPanel.ClientEvents.ExtEvents.Values['eventsrendered'] :=
    'function (sender, eOpts)' +
    '{           var curView = sender;' +
    '            var evtElements = Ext.select(''.ext-cal-evt'', true);' +
    '            if (evtElements)' +
    '            {' +
    '                Ext.each(evtElements.elements, function(eachEl) {' +
    '                    var evtId = curView.getEventIdFromEl(eachEl);' +
    '                    var rec = sender.getEventRecord(evtId);' +
    '                    if (!Ext.isEmpty(rec)) {' +
    '                      if (!Ext.isEmpty(evtId)){' +
    '                          var pop_content =  "<div id=''popup-data''><p><b>Detalles: </b>" +rec.data.Notes.replace(/\n/g, "<br />")+"</p></div>";' +
    '                            new Ext.ToolTip({' +
    '                             target: eachEl' +
    '                             ,title: rec.data.Title' +
//    '                             ,dismissDelay: 2000 // auto hide after 2 seconds' +
//    '                             ,anchor: ''top''' +
//    '                             ,anchorOffset: 85' +
    '                             ,trackMouse: true' +
    '                             ,html: pop_content' +
    '                            });  ' +
    '                      }' +
    '                    }' +
    '                }, this);' +
    '            }' +
    '}';
  • Like 1
  • Upvote 1
Link to comment
Share on other sites

  • 5 years later...
×
×
  • Create New...