dhtmlxDblCalendarObject -- setPosition() not working in IE

I am trying to set the doublecalendar’s position using the following code:



[code]


doubleCal.leftCalendar.setPosition(topPos,leftPos);

doubleCal.rightCalendar.setPosition(topPos,leftPos+164);


[/code]



With FireFox 3.0.5, this works fine.

IE 6 (SP2) however reports the following error:



Line: 92

Char: 213

Error: ‘this.ifr.style’ is null or not an object

Code: 0



Using a single calendar, IE works well:

[code]


singleCal.setPosition(topPos+20,leftPos+2);


[/code]



I am using dhtmlxCalendar v.1.1 build 81107



Many thanks for your help.

The setPosition method is not purposed for such use-case ( positioning of separate calendars inside dblCalendar )
If this is really necessary in your case, you can set related css settings directly as

doubleCal.leftCalendar.parent.style.top = topPos+“px”;
doubleCal.leftCalendar.parent.style.left = leftPos+“px”;

Sorry, but it’s not working.

The doubleCalendar is displayed in the browser’s top left corner (as if I would not have specified any positioning data).

In your reply, you mentioned that setPosition() is not meant to position separate calendars inside the doubleCalendar object.

Is there a way to set the position for the whole doubleCalendar (instead of doing it separately for the left and right calendar)?

Many thanks for your help!

There is no separate method for dblCalendar, but if you initializing dblCalendar in some HTML container you can just change position of such object. ( first parameter of constructor )

This does the trick - thank you very much!

For documentation purposes:

      function doCreateDoubleCalendar(clickedDateFilter) {
        var doubleCalImgId = clickedDateFilter + “_double_date_picker”;
        var leftPos = findPosX(document.getElementById(doubleCalImgId));
        var topPos = findPosY(document.getElementById(doubleCalImgId));
        if (is_IE) {
          document.getElementById(“doubleCal_container”).style.top = topPos + 20;
          document.getElementById(“doubleCal_container”).style.left = leftPos + 2;
        } else { // FF 3.0
          doubleCal.leftCalendar.setPosition(topPos-65,leftPos-6);
          doubleCal.rightCalendar.setPosition(topPos-65,leftPos+158);
        }
        doubleCal.show();
      // blahblah…