Nov 08, 2010, 8:14 AM
formatting of json date in a Grid Panel
Hello I am new to Ext.Net controls and I am trying to fix someone else's code, so excuse me for my silly question:
Data are being retrieved in jquery as such:
Data are being retrieved in jquery as such:
jsonStore = new Ext.data.JsonStore({
autoDestroy: true,
autoLoad: true,
messageProperty: 'message',
proxy: new Ext.data.HttpProxy({
method: 'POST',
url: '<%= Url.Action("ListInJSON", "Lab", new { patnum = ViewData["patnum"]}) %>'
}),
root: 'events',
fields: ['ticks', 'description', 'id', 'patientnumber', 'patientname', 'doctor', 'date', 'date_out', 'time_in', 'time_out', 'lab', 'labcode', 'remark', 'note']
});
while Grid Panel is being created as suchgrid = new Ext.grid.GridPanel({
store: jsonStore,
stripeRows: true,
height: 600,
title: "Results",
columns: [
{ dataIndex: 'description', sortable: false, header: 'Date-in' },
{ dataIndex: 'date_out', sortable: true, header: 'Date-out', renderer: Ext.util.Format.dateRenderer('m/d/Y') ],
viewConfig: {
forceFit: true
},
selModel: new Ext.grid.RowSelectionModel({ singleSelect: true })
});
Date_out field is of type date and is being returned as json serialized string. When I added the rendered property, the display showed NaN/Nan/Nan. According to the reponse above, I am supposed to link the data with a converter method to be able to convert the ticks to type date. Where do I put this in my jquery syntax?