dataprocessor and dhxcalendar - change data before sending t

We are using dhtmlXDataProcessor v.1.0 build 71114. to send updates to JSP. We use v1.5 for rest of grid js files.

The grid we have, uses dhxCalendar. After adding a row, the data is sent to JSP using dataprocessor. But, the date is sent in various formats depending on time zone like Mon May 12 00:00:00 UTC+0530 2008, Mon Jul 3 00:00:00 EDT 2000



When this parameter goes to JSP, the + in Mon May 12 00:00:00 UTC+0530 2008 is replaced by a space and we are unable to use this date.



Can you tell how to modify the date to dd-MMM-yyyy format before sending to JSP.

I tried to use setOnBeforeUpdateHandler, but none of the added rows are sent to JSP.



Also, when I try to sort column with type dhxcalendar, I get js error.

When using dhxCalendar, if I double click on date, the calendar does not close until I mouse click somewhere else on the page.

Below is the code used.

Please advise.





























debtgrid = new dhtmlXGridObject(‘gridDebtResult’);

debtgrid.setImagePath(“widgets/dhtmlxgrid/images/dhtmlXGrid/”);        

debtgrid.setHeader(“

Debt
,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan”);

debtgrid.attachHeader(“
Fiscal
,
Effective
,
Expiry
,
Source
,
ShortTerm
,
LongTerm
,
Total
,
Notes
,
Mod By
,
Mod When
”);

debtgrid.setInitWidths("100,100,100,100,80,80,80,,60,100");

debtgrid.setColAlign(“center,center,center,left,right,right,right,left,left,center”);

debtgrid.setColTypes(“dhxCalendar,dhxCalendar,ro,ed,edn[=c4],edn[=c5],edn[=c6],ed,ro,ro”);

debtgrid.setColSorting(“date,date,str,str,int,int,int,str,str,date”);

debtgrid.setScrollbarWidthCorrection();

debtgrid.setDateFormat("%d-%b-%Y");

debtgrid.setNumberFormat(“0,000.00”, 4);

debtgrid.setNumberFormat(“0,000.00”, 5);

debtgrid.setNumberFormat(“0,000.00”, 6);

debtgrid.attachEvent(“onEditCell”,editSource);                                        

debtgrid.setSkin(“boa”);

debtgrid.init();

debtgrid.setOnLoadingEnd(OnDebtGridLoad);

debtgrid.enableAlterCss(“odd_boa”,“even_boa”);

        

//debtgrid.loadXML(“myPage.htm?method=loadDebt&<%=MyController.ISSUER_ID_PARAM%>=” + ${issuerId});



/
@ Data Processor for Debt*/

debtProcessor = new dataProcessor(“debtform.htm”);

debtProcessor.setVerificator(0);

debtProcessor.setVerificator(1, function(value, colName){return checkIfUniqueDate(debtgrid, value, 1, colName)});

debtProcessor.setVerificator(4, checkIfValidNumber);

debtProcessor.setVerificator(5, checkIfValidNumber);

debtProcessor.setUpdateMode(“off”);

debtProcessor.setTransactionMode(“POST”);

//debtProcessor.setOnBeforeUpdateHandler(onBeforeDebtUpdate);        

debtProcessor.setOnAfterUpdate(onAfterDebtUpdate);

debtProcessor.init(debtgrid);



function onBeforeDebtUpdate(rowId){

    alert("jsp: " + debtgrid.cells(rowId,0).getValue());

    var fiscalDate = new Date(debtgrid.cells(rowId,0).getValue());

    var effectiveDate = new Date(debtgrid.cells(rowId,1).getValue());

    debtgrid.cells(rowId,0).setValue(fiscalDate.getDate()+ “-” + fiscalDate.getMonth()+1 + “-” + fiscalDate.getYear());

    debtgrid.cells(rowId,1).setValue(effectiveDate.getDate()+ “-” + effectiveDate.getMonth()+1 + “-” + effectiveDate.getYear());    

}


>>Can you tell how to modify the date to dd-MMM-yyyy format before sending to JSP.



The issue was fixed in latest code, please try to use attached js file instead of original one, with it you will receive data in same format as it rendered in the grid.




>>Also, when I try to sort column with type dhxcalendar, I get js error.



Please try to use attached dhtmlxcalendar.js instead of original one ( which had problem with %b format option )
If problem still occurs for you - please send any kind of the sample, where problem can be reconstructed ( you can send it directly to support@dhtmlx.com ), because the same code as in snippet above works correctly with latest code.




 


dhtmlxgrid_excell_calendar.zip (1.1 KB)
dhtmlxcalendar.zip (11.8 KB)