seanjensengrey / jsgantt

Automatically exported from code.google.com/p/jsgantt
0 stars 0 forks source link

Break gantt layout when distance between StartDate and EndDate very large ( >4,5 years) #111

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

What steps will reproduce the problem?

- This occurs on a GanttChart of SharePoint. The cause is gantt drew a large 
number of <td> tag at the header.

- This is only occurs on IE8/9 , IE7/FireFox/Scrome is ok all.

Code Segment : 
while(Date.parse(vTmpDate) <= Date.parse(vMaxDate))
{
   if(vFormat == 'day' )
   {
       if( JSGantt.formatDateStr(vCurrDate,'mm/dd/yyyy')    ==JSGantt.formatDateStr(vTmpDate,'mm/dd/yyyy')) 
       {
           vWeekdayColor  = "ccccff";
           vWeekendColor  = "9999ff";
           vWeekdayGColor  = "bbbbff";
           vWeekendGColor = "8888ff";
       } 
       else 
       {
           vWeekdayColor = "ffffff";
           vWeekendColor = "cfcfcf";
           vWeekdayGColor = "f3f3f3";
           vWeekendGColor = "c3c3c3";
       }

       if(vTmpDate.getDay() % 6 == 0) 
       {
           vDateRowStr  += '<td class="ms-vb gheadwkend"  style="BORDER-TOP: #efefef 1px solid; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid;" bgcolor=#' + vWeekendColor + ' align=center><div style="width: '+vColWidth+'px">' + vTmpDate.getDate() + '</div></td>';
                  vItemRowStr  += '<td class="ms-vb gheadwkend" style="BORDER-TOP: #efefef 1px solid; BORDER-LEFT: #efefef 1px solid; cursor: default;"  bgcolor=#' + vWeekendColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp</div></td>';
       }
       else 
       {
           vDateRowStr += '<td class="ms-vb ghead" style="BORDER-TOP: #efefef 1px solid; HEIGHT: 19px; BORDER-LEFT: #efefef 1px solid;"  bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">' + vTmpDate.getDate() + '</div></td>';
           if( JSGantt.formatDateStr(vCurrDate,'mm/dd/yyyy') == JSGantt.formatDateStr(vTmpDate,'mm/dd/yyyy')) 
               vItemRowStr += '<td class="ms-vb ghead" style="BORDER-TOP: #efefef 1px solid; BORDER-LEFT: #efefef 1px solid; cursor: default;"  bgcolor=#' + vWeekdayColor + ' align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
           else
               vItemRowStr += '<td class="ms-vb ghead" style="BORDER-TOP: #efefef 1px solid; BORDER-LEFT: #efefef 1px solid; cursor: default;"  align=center><div style="width: '+vColWidth+'px">&nbsp&nbsp</div></td>';
       }
       vTmpDate.setDate(vTmpDate.getDate() + 1);

    }
}   

What is the expected output? What do you see instead?

Don't break layout.

Please provide any additional information below.

Great Job with the rest.Thanks

Original issue reported on code.google.com by nguyenlo...@gmail.com on 20 Mar 2012 at 8:26