Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tom on Jul 02, 2009 10:10
open dhtmlx forum
dhtmlxscheduler

I'm running into an issue where if the dhtmlxscheduler control is placed within a simple table or div it won't render. Using dhtmlxscheduler_debug.js, it looks like the issue is an "Invalid argument" error in scheduler.set_xy, on line node.style.width=w+"px";.

Here are a couple examples from the sample_static.html in the demo to demonstrate the general idea.

<body onload="init();" style="margin:0px; padding:0px; height:100%;">
<div id="box">
    <div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
        <div class="dhx_cal_navline">
            <div class="dhx_cal_prev_button"> </div>
            <div class="dhx_cal_next_button"> </div>
            <div class="dhx_cal_today_button"></div>
            <div class="dhx_cal_date"></div>
            <div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
            <div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
            <div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
        </div>
        <div class="dhx_cal_header">
        </div>
        <div class="dhx_cal_data">
        </div>        
    </div>
</body>

or

<body onload="init();" style="margin:0px; padding:0px; height:100%;">
<table>
<tr>
<td>
<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
         <div class="dhx_cal_navline">
             <div class="dhx_cal_prev_button"> </div>
             <div class="dhx_cal_next_button"> </div>
             <div class="dhx_cal_today_button"></div>
             <div class="dhx_cal_date"></div>
             <div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
             <div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
             <div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
         </div>
         <div class="dhx_cal_header">
         </div>
         <div class="dhx_cal_data">
         </div>    
</td>
</tr>    
</table>
</body>
Answer posted by Stanislav on Jul 03, 2009 15:05
Scheduler takes their size, from related html element of moment of initialization
There are two situation possible 

a) you calling init code while html cod not fully rendered yet ( table not closed for example ) - in such state table has not any size assigned and 100% of schedulers width can't be converted to any fixed value ( moving init code in onload handler can help in such situation ) 

b) external div or table element has not any specified width  - same as above 100% can't be converted to fixed value and produces error.