DHTMLX Docs & Samples Explorer

setPosition(pos)

Sets the position pop-up calendar will appear from (applied just to calendar initialized as date input field).

Parameters:

  • pos - the position of pop-up calendar.

    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);