search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Daypilot height 100%

Asked by Maheswar Reddy
9 years ago.

I am trying make daypilot schedular height as '1200px'.But is not working.Please find the code following.

var dp = new DayPilot.Scheduler("divScheduler");

dp.heightSpec = "Max";
dp.height = '100%';
dp.heightSpec = "Parent1200Pct";

Answer posted by Dan Letecky [DayPilot]
9 years ago.

If you want to set the height to 100% of the parent element, you should use this:

dp.heightSpec = "Parent100Pct";

Please note that this requires the parent element height to be set explicitly - see also http://doc.daypilot.org/scheduler/100-pct-height/.

If you want to set the height to 1200px you should use this:

dp.heightSpec = "Fixed";
dp.height = 1200;
Comment posted by Maheswar Reddy
9 years ago.

My Code is like that but still not-working.

<div style="height:100%">
<div id="divScheduler">

</div>
</div>

var dp = new DayPilot.Scheduler("divScheduler");

dp.heightSpec = "Parent100Pct";

I have tries like this also but this also not working.

<div style="height:700px">
<div id="divScheduler">

</div>
</div>

var dp = new DayPilot.Scheduler("divScheduler");
dp.heightSpec = "Fixed";
dp.height = 1200;

Comment posted by Dan Letecky [DayPilot]
9 years ago.

For .heightSpec = "Parent100Pct" to work the parent element height has to be either fixed (style="height:1000px" or style="position:absolute;top:0px;bottom:0px") or the percentage height has to be set on all ancestors up to <html> element (or another element with fixed height).

This is by definition - you need at least one fixed height in the chain if you are using percentage height. By default the div height is determined from its content. This determines the parent height - up to the top level. When using 100% on the bottom level (without setting the reference point using "position" style) the browser doesn't know how to set it - 100% of what? In this case the fixed point has to be the browser window and all children heights need to be derived from that.

See also a working DOM structure here:
http://doc.daypilot.org/scheduler/100-pct-height/

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.