Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by William on Oct 28, 2009 14:32
open dhtmlx forum
dhtmlxgrid form submission does not submit date on the new row

dhtmlxgrid form submission does not submit the date value (picked from the dhtmlxcalendara) on the new row.
To reproduce:
- Insert a new row in the datagrid.
- On that new row, select a date from the dhtmlxcalendara field.
- Submit the form.

When I inspect the submitted values, the date value on the new row is empty.
Here is my code (java, jsp, spring...):
<form id="collectionForm" method="post">
    <div id="gridbox" style="width:1000px; height:270px; background-color:white;"></div>
    <form:hidden id="gridXml" path="collectionForm.gridXml" />
    
    <table>
        <tr>
     <td> </td>
     <td> </td>
     <td> </td>
     </tr>
     <tr>
     <td>
         <a href="#" onclick="addRow()">Insert</a>
     </td>
     <td> </td>
     <td>
         <input type="submit" value="Save" onclick="serialize();"/>
     </td>
     </tr>
    </table>
</form>



<script>


    function serialize() {
     mygrid.setSerializationLevel(false, false, true);
     document.getElementById("gridXml").value = mygrid.serialize();
    }

    function addRow() {
        var today = todayStr();
        mygrid.addRow(mygrid.uid(), ['', '', '', '', '', '', '', ''], 0);
    }
        
    mygrid = new dhtmlXGridObject('gridbox');
    mygrid.setImagePath("<c:url value="/dhtmlx/dhtmlxGrid/imgs/"/>");
    mygrid.enableAutoWidth(true);
    mygrid.enableAutoHeight(true);
    mygrid.setSkin("gray");
    mygrid.setDateFormat('%m/%d/%Y');
    mygrid.init();
    mygrid.loadXMLString(document.getElementById("gridXml").value);

</script>
Answer posted by Support on Oct 29, 2009 04:44
To fix this issue replace your dhtmlxgrid_excell_dhxcalendar.js with file attached here http://dhtmlx.com/docs/products/kb/index.php?s=normal&q=11493