Positioning of dhtmlxCalendarObject

The dhtmlxCalendarObject has been linked to an input box. Unfortunately the calendar box is displayed right of the input box and is hidden by a flash file that is running right of the input box. Is there an option to position the dhtmlxCalendarObject with fixed x and fixed y values?



Best regards



St�phane

In case, when you creating calendar linked to input - it initial position will be always right to input ( can be changed only by source code modification - dhtmlxcalendar.js , line 493 )
The positions of calendar object can be changed by
    calendar.setPosition(x,y); // x and y are int values

Dear support,

thank you for your quick help. The file dhtmlxcalendar.js has only one declaration using setPosition in line 1190:

/**
  @desc: set position for calendar object
  @type: public
  @topic: 0
/
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”;
    this.entObj.style.left = (left||argB)+“px”;
}

Is that the part that has to be changed?

Best regards

Stephane Martin

If you need just to set position of calendar you can use
    calendar.setPosition(x,y);
where calendar - object returned by dhtmlxCalendar constructor.

If you want to change default behavior please check dhtmlxgrid.js line 493
        with (div.style) {
            position = ‘absolute’;
            display = ‘none’;
            marginLeft = this.con.offsetWidth+‘px’;
            top = atop;
            left = aleft;
            zIndex = “99”;

This is styles of calendars parent container, you can update them in any necessary way.

If you need just to set position of calendar you can use
    calendar.setPosition(x,y);
where calendar - object returned by dhtmlxCalendar constructor.

Thanks that was the trick :slight_smile:

Best regards

Stéphane