wrong position

I can’t find out what I’m doing wrong. but the calendar position is always ont the bottom of the page.

And of course in ie: operation aborted















































































test












>>And of course in ie: operation aborted


dhtmlx.com/docs/products/kb/inde … e=1&q=4363
You need to move calendar initialization code to onload event


Example of onload event for your case :





































test







Please check the attached dhtmlxcalendar.zip archive to obtain fixed version of dhtmlxcalendar.js

dhtmlxcalendar.zip (12 KB)

thanks for the solution.

I had some error’s in the recent posted dhtmlcalendar.zip

1) wrong arguments?

dhtmlxCalendarObject.prototype.setPosition = function(argA,argB,argC){
    if(typeof(argA)==‘object’){
        var posAr = this.getPosition(argA)
        var left = posAr[0]+argA.offsetWidth+(argC||0);
        var top = posAr[1]+(argB||0);
    }
    this.entObj.style.position = “absolute”;
    this.entObj.style.top = (top||argA)+“px”; —> argB instead of argA
    this.entObj.style.left = (left||argB)+“px”; ----> argC instead of argB
}

2) put remarks in front of <<<<<<.mine, =========,>>>>>>>

dhtmlxCalendarObject.prototype.show = function(){
    this.parent.style.display = ‘’;

    if (this.con.nodeName == ‘INPUT’) {
        var aleft = getAbsoluteLeft(this.con);
        var atop = getAbsoluteTop(this.con);
        this.parent.style.left = getAbsoluteLeft(this.con) + ‘px’;
        this.parent.style.top = getAbsoluteTop(this.con) + ‘px’;
    }   
//<<<<<<< .mine
   
    if(_isIE){//add iframe under calendard in IE (IE 6 issue with select box fix)
        this.parent.style.width = “0px”;
        this.parent.style.height = “0px”;
        if(this.parent.style.zIndex==0){
            this.parent.style.zIndex = 10;
        }
        if(this.parent.style.position == “absolute” && this.ifr==undefined){
            this.ifr = document.createElement(“IFRAME”);
            this.ifr.style.position = “absolute”;
            this.ifr.style.zIndex = “0”;
            this.ifr.frameBorder = “no”;
   
            this.ifr.src = window.dhx_globalImgPath+"/blank.html"
            this.ifr.style.top = this.parent.offsetTop + ‘px’;
            this.ifr.style.left = this.parent.offsetLeft + ‘px’;
            this.ifr.className = this.style + “_ifr”;
            this.ifr.style.className = this.style;
            this.parent.parentNode.appendChild(this.ifr)
        } else {
          this.ifr.style.top = this.parent.offsetTop + ‘px’;
            this.ifr.style.left = this.parent.offsetLeft + ‘px’;
        }
    }
//=======
//>>>>>>> .r1612

    if (this.ifr != undefined)
    {
      this.ifr.style.top = this.parent.offsetTop + ‘px’;
        this.ifr.style.left = this.parent.offsetLeft + ‘px’;
        this.ifr.style.display = ‘block’;
    }   
//    this.draw();
}

  1. Arguments are correct
    If “argA” is object,  then :
    calendar.top = object.top + argB
    celendar.left = object.left + object.widht + argC
    else if “argA” is not object :
    calendar.top = argA
    calendar.left = argB

    If you need to set absolute coordinates just use cal.setPosition (y, x);

    2) ou have to replace your dhtmlxcalendar.js with dhtmlxcalendar.js from attachment in the previous post


    setPosition exmaple in attachment.
    cal_setPosition.html.zip (911 Bytes)