Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Charlie R Chisholm on Jun 26, 2008 17:59
open dhtmlx forum
Date not displaying in a dhxCalendar column

I have a rather complex grid and am having a problem getting date data to display. I have added a portion of the code and a portion of the xml below. In row 1, I have dates in the xml. I have defined the whole row as dhxCalendar type. The calendar works fine and the dates are saved, but I can't get the dates to display.

If you tell me how, I will upload the whole XML file (251 lines) and all of the code (309 lines) and a screen shot of the problem. To much to include here, I think.

Charlie

CODE SNIPIT

bodyg = new dhtmlXGridObject('bodygrid');
    bodyg.setImagePath("/grid3/dhtmlxgrid/codebase/imgs/");
    bodyg.setColTypes("ro,ro,ed,ed,ed,ed,ed,ed,ed,ed,ro");
bodyg.enableCollSpan(true);
    bodyg.loadXML("/grid3/queries/expgrid.cfm?sec=2&fid=#attributes.fid#");

    bodyg.attachEvent("onXLE",loadBody);

    bodyg.enableEditEvents(true,true,true);
    bodyg.enableLightMouseNavigation(true);
    bodyg.setStyle("background: white;", "background: white;", "background: yellow;", "background: lime;")
bodyg.setOnEditCellHandler(doOnCellEdit);
    bodyg.setDateFormat("%m/%d/%y");

...

XML SNIPIT

<?xml version="1.0" encoding="UTF-8"?>
<rows>
<head>
<column width="70" type="ro" align="left" color="white" sort="none"></column>
<column width="60" type="ro" align="center" color="white" sort="none"></column>
<column width="60" type="ed" align="right" color="white" sort="none"></column>
<column width="60" type="ed" align="right" color="white" sort="none"></column>
<column width="60" type="ed" align="right" color="white" sort="none"></column>
<column width="60" type="ed" align="right" color="white" sort="none"></column>
<column width="60" type="ed" align="right" color="white" sort="none"></column>
<column width="60" type="ed" align="right" color="white" sort="none"></column>
<column width="60" type="ed" align="right" color="white" sort="none"></column>
<column width="70" type="ed" align="center" color="white" sort="none"></column>
<column width="70" type="ro" align="center" color="white" sort="none"></column>
</head>
    <row id="0">
        <cell colspan="2"></cell>
        <cell></cell>
        <cell type="ro">Sun</cell>
        <cell>Mon</cell>
        <cell>Tue</cell>
        <cell>Wed</cell>
        <cell>Thu</cell>
        <cell>Fri</cell>
        <cell>Sat</cell>
        <cell>Charged to Agency</cell>
        <cell>Paid by Employee</cell>
    </row>
    <row id="1">
        <cell colspan="2">Date</cell>
        <cell></cell>
        <cell>06/01/08</cell>
        <cell>06/02/08</cell>
        <cell>06/03/08</cell>
        <cell>06/04/08</cell>
        <cell>06/05/08</cell>
        <cell>06/06/08</cell>
        <cell></cell>
        <cell></cell>
        <cell></cell>
    </row>
    <row id="2">
        <cell colspan="2">City</cell>
        <cell></cell>
        <cell>St Pete1</cell>
        <cell>Hills2</cell>
        <cell>Spring HIll4</cell>
        <cell>Ocala4</cell>
        <cell>Brandon5</cell>
        <cell>Largo6</cell>
        <cell>LOL7</cell>
        <cell></cell>
        <cell></cell>
    </row>
    <row id="3">
        <cell>Personal Car</cell>

....
Answer posted by Support on Jun 27, 2008 02:45
Please try to use attached js file instead of original one ( this is latest version, which has some minor date formating issues resolved )
If problem still occurs for you - please send any kind of sample where issue can be reconstructed to support@dhtmlx.com

>>I have defined the whole row as dhxCalendar type
Not sure , how it was done in your case, but with setRowExcellType - the same XML works correclty locally.
Attachments (1)
Answer posted by Charlie R Chisholm on Jun 27, 2008 17:05

Found the problem.  There apparently is a bug that makes the setRowExcellType function not work properly if one of the columns in the row is joined with another row.  For instance, I had ...

   bodyg.setRowspan(0,9,4);
   bodyg.setRowspan(0,10,4);

   setRowExcellType(1,"dhxCalendar")

so, since I had defined a column in row 0 to span 4 rows, that would effect row 1.  Then when I tried to set row 1 to the dhxCalendar type, it wouldn't work.

I confirmed this was the problem by removing the row span and the row 1 calendar columns worked fine.  I then removed the setRowExcellType(1,"dhxCalendar") and replaced it with several setCellExcellType and everything works great.  Just thought I would pass this along incase you wanted to fix the bug or to post the limitation so others aren't fighting through the same problem.

By the way, I like your products VERY much.

Charlie

Answer posted by Support on Jun 28, 2008 04:17
The problem confirmed ( with current design, the rowspaned section can be accessed only by coordinates of its topmost cell , the row oriented commands will not affect it )
We will try to resolve situation in next version.