position lightbox

when i make a new event, the lightbox opens, but it opens at the top of the screen, and i have to scroll to the top to fill it in.

is there an option to make the lightbox always open in the centre of the screen?

Actually it must open at center of screen. ( for version 2.0 and later )

It possible that you have some complex page layout, because of which position can’t be calculated correctly. You can redefine showCover method with some hardcoded values

schedulder.showCover = function(box){ this.show_cover(); if (box){ box.style.display="block"; box.style.top=DESIRED_TOP+"px"; box.style.left=DESIRED_LEFT+"px"; } }

where can i put this code? the scheduler doesnt work anymore if i place it between the headers.

in the script block, anywhere on the page ( before or after scheduler.init - it doesn’t matter )
of course - DESIRED_TOP and DESIRED_LEFT need to be replaced with actual values

it works now, but still doesnt fix my problem, when i center the lightbox in the middle of the page, i still need to scroll up or down, depending on what time i make an event…

is there a way to insert margin/vertical-align into the function?

i still need to scroll up or down
If you have a “focus” attribute defined for any field in the ligtbox ( defined for “text” by default ) - grid will auto-scroll page to show focused element, so form will be visible without any extra steps.

this is already a lot better, but i still cant see the description of the inputfield, and have to scroll up a little bit.

The next may help , but it depends on used page structure

schedulder.showCover = function(box){ this.show_cover(); if (box){ box.style.display="block"; box.style.top=DESIRED_TOP+"px"; document.body.scrollTop = DESIRED_TOP; //this line need to be added box.style.left=DESIRED_LEFT+"px"; } }