PDA

View Full Version : DataColumn Date Format.



grmontero
Mar 05, 2009, 12:47 PM
Hello.
I'm using this code... and Don't work for me.
someOne.. can help me Please.!




Dim _col As New Coolite.Ext.Web.Column
_col.DataIndex = column.ColumnName.Trim
_col.Header = DatosColumna.ColTitulo
Dim strformat As String
strformat = "d/m/Y"
rn.Fn = "Ext.util.Format.dateRenderer('" + strformat + "')"
_col.Renderer = rn
grid.ColumnModel.Columns.Add(_col)


And render "NaN/NaN/NaN" in my gridPanel column.

What i'm doing Wrong-..?

Thanks...!

Gustavo Montero G.

geoffrey.mcgill
Mar 05, 2009, 3:40 PM
Hi grmontero,

I would appear the record value is not being converted into a Date object correctly, before being passed to the dateRenderer. 


Typically in the Store you would define a RecordField similar to the following:



<ext:RecordField Name="MyDateTimeField" Type="Date" />


If MyDateTimeField is a DateTime object on the server, then the record field will be automatically parsed into a Date object on the client and passed correctly into the dateRenderer. 


We might need to see some more code or even better a simplified .aspx code sample demonstrating the full scenario. 


Hope this helps.

grmontero
Mar 05, 2009, 4:33 PM
Yes... !


Thank's Geoffrey.