PDA

View Full Version : Date format renders but grid.getstore data remains unchanged



pegasus
11 Nov 2009, 1:34 PM
Hello all,

There are many references to Date format rendering here which I have followed to get the following:




I have a columnmodel inside an editorgridpanel with custom renderers based on data type.

formatDate(value){
return value ? value.dateFormat('m/d/Y') : '';
}


Editor for the date filed is : new Ext.form.DateField({format: 'm/d/y'})
I can see the rendering action on the row when it is edited, but when sent to the server via grid.getStore().data.items the date format is still Thu Nov 19 2009 00:00:00 GMT-0500 (EST)


I know there is a solution for this but I'm not able to figure it out.


Many thanks!

mystix
14 Nov 2009, 7:36 AM
column renderers merely format Record data for display.

your date column's underlying data is still a plain-old js Date object.
you'll need to create a string representation of that js Date object in the required format and send that over the wire instead.