Need to setDateFormat Only for Updated Cells

Hello,

I am using DHTMLXGrid 2.1 with editable dhxCalendar excells. Since date formatting on the client side is slow, I would like to do my date formatting on the server side. However, I still need to use grid.setDateFormat() to make sure that the format used by the calendar widget matches the formatting being done on the server.

Is there a way to specify the format to be used by the calendar widget, but NOT have the DHTMLX grid reformat every date when the grid loads?

Thanks,
Bryan

Grid will not reformat every date when the grid loads. It will reformat date only after you select any date from dhxCalendar cell editor. So you can use “onEditCell” event to catch when the user change value of the dhxCalendar cell and format it back to the original format.

docs.dhtmlx.com/doku.php?id=dhtm … oneditcell

I’m not sure I fully understand.

My dates are being formatted as ‘%b %e, %Y’ on the server:

-If I DON’T call grid.setDateFormat(’%b %e, %Y’), the calendar widget automatically defaults to December 31, 1969 when I click to edit. I assume this is because the default format the calendar is looking for does not match the format being used on the server.

-If I DO call grid.setDateFormat(’%b %e, %Y’), the calendar widget correctly interprets the existing date when I click to edit. However, the grid takes over twice as long to initially load. I assume this is because the grid is formatting ALL of the dates using the specified format (even though I’ve already done this on the server).

In short, I need to tell the calendar widget what format to look for, but NOT have it format everything.

However, the grid takes over twice as long to initially load.
What version of dhtmlxGrid do you use? How much rows do you have in your grid?

In short, I need to tell the calendar widget what format to look for,
To tell the calendar widget what format to look for you should use setDataFormat() method. There is no another way to specify date format which will calendar use.

but NOT have it format everything
It not possible without component customization.

I am using DHTMLX grid version 2.1. The data set I am currently testing with, and experiencing double the load time when using setDateFormat, only has 98 rows. However, my application will need to support much much larger data sets in the future.

This issue was fixes at the latest version of dhtmlxGrid. You can download new version here dhtmlx.com/docs/download.shtml