DHTMLX Docs & Samples Explorer

setPosition(pos) or setPosition(x, y)

When calendar attached to input - define where it will appear, “right” or “bottom” (default)
When calendar attached to custom parent - you also able to pass x and y coordinates directly

Parameters:

  • pos - the position of calendar
  • x, y - int, coords
myCalendar.setPosition("right");

Description:

There are 2 ways to call the method:

  1. Common way. Called just once and continues to work until you change the value.
    Available values:
    • bottom (default value);
    • right

  2. Absolute positioning. Should be called when calendar is opened and continues to work while calendar is visible. The next time you open a calendar the specified position won't be applied.

    // common way 
    myCalendar.setPosition("right");
     
    // positioning
    // sets left and top absolute offsets of calendar
    myCalendar.setPosition(10, 20);
    // sets just left absolute offset of calendar
    myCalendar.setPosition(10);
    // sets just top absolute offset of calendar
    myCalendar.setPosition(null, 20);