10584 : Is it possible to add javascript event to the timeitems ?

Question

Is it possible to add javascript event to the timeitems ? I have made a tooltip that i use everywhere in our web application. I would like to use the same tooltip but i can’t find how to add javascript event on the timeitems. What i need to do is display information when the mouse is over a timeitems. This information need to be place a array (The tooltil will be 200px X 300 px) so i need to use html code. The tooltip i’ve made allow me to do this so if it’s not possible to use my tooltip is there any other way to do this

Answer

Yes you can inject a reference to your own javascript if you implement the event OnAreaAttributes. In the sample below the onMouseOver event is used to set the status field of the browser but you could just as well call your own javascript.


    private void Gantt_ASP1_OnAreaAttributes(PlexityHide.GTP.WEB.Gantt_ASP aGantt, PlexityHide.GTP.WEB.AreaAttributeEventArgs e)
    {
      if (e.AreaKind==PlexityHide.GTP.WEB.AreaKind.TimeItem)
      {
        
        e.Result=" Title=\"You are now over a time item\" onMouseOver=\"self.status='Hey man, your are over a time item';return true\" ";
      }
      else
      if (e.AreaKind==PlexityHide.GTP.WEB.AreaKind.TimeItemRow)
      {
        e.Result=" Title=\"Click this one if you are happy\" onMouseOver=\"self.status='YOU ARE NOW ON THE ROW, and not over a time item';return true\" ";
      }
      else
      {
        e.Result=" onMouseOver=\"self.status='---';return true\" "+e.Result;
      }

    }

Leave a Reply