Loading ...
Sorry, an error occurred while loading the content.

Calendar Bug in IE7 in render method?

Expand Messages
  • Steve Rogers
    Hi, I am trying to develop using the latest YUI (2.2.1) Calendar object. My code, which loads a single Calendar is below. Based on the alert s I used for
    Message 1 of 2 , Apr 27, 2007
    • 0 Attachment
      Hi, I am trying to develop using the latest YUI (2.2.1) Calendar object.

      My code, which loads a single Calendar is below. Based on the alert's I used for
      debugging, the error occurs at the .render step in the initCal method only on IE7, it works
      great in FireFox 2.

      function initcal()
      {
      //alert('creating teh calendar and listeners');
      var overlay = document.getElementById("startdate");
      var parent = overlay.offsetParent;
      var x = 0;
      var y = 0;
      while (parent)
      {
      //alert('parent = '+parent);
      x = x + parent.offsetLeft;
      y = y+ parent.offsetTop;
      parent = parent.offsetParent;
      }
      //alert(' position at "'+x+'" and "'+y+'"');
      var cal = document.getElementById("callContainer");
      with (cal.style)
      {
      left = x;
      top = y;
      }

      YAHOO.registry.calendar.evCal = new YAHOO.widget.Calendar("evCal","callContainer",
      {selected:"$registry.getMmddyyyyStartDate()",
      pagedate:"$registry.getMmyyyyStartDate()", title:"Choose a date:", close:true} );
      //alert('cal created');
      YAHOO.registry.calendar.evCal.selectEvent.subscribe(handleSelect,
      YAHOO.registry.calendar.evCal, true);
      alert('registered selectevent');
      YAHOO.registry.calendar.evCal.render();
      alert('rendered...');
      var rslt = YAHOO.util.Event.addListener
      ("startdate","click",YAHOO.registry.calendar.evCal.show,
      YAHOO.registry.calendar.evCal, true)
      //alert('added listener to date field, rslt = '+rslt);
      }
      YAHOO.util.Event.addListener(window, "load", initcal);

      I am wondering if this is a bug, of if anyone has ideas on how I can solve it.

      Thanks,
      Steve
    • Steve Rogers
      HI all - I solved my cross browser problem. After much debugging of the scripts and my code, I found that my which is the
      Message 2 of 2 , Apr 28, 2007
      • 0 Attachment
        HI all -

        I solved my cross browser problem. After much debugging of the scripts and my code, I
        found that my <div id="callContainer"></div> which is the outercontainer for the Yahoo
        Calendar object was located outside the bounds of an HTML element. It was between two
        <tr> elements.

        Firefox is forgiving. But IE got an object error when attempting to write the .innerHTML
        property (in the calendar.js render() method). During the course of debugging, I was able to
        read from this object, but could not write to it.

        ANyway, problem solved. It was just an HTML structure problem.

        Cheers,
        Steve
      Your message has been successfully submitted and would be delivered to recipients shortly.