View Full Version : GridPanel Array Column - how do i get a single value?

6 Apr 2010, 2:14 AM
Im reading data from MS SQL Server and a field is of type [DateTime] which is returned in the following format:

"log_date":{"date":"2010-03-14 00:00:00","timezone_type":3,"timezone":"UTC"}

now when i load the data into the grid, the column's data is displayed as

[object Object]

i only want to display the date part without the timezone_type or timezone. How would i achieve that?

6 Apr 2010, 2:36 AM
i think i found a way (http://www.extjs.com/forum/showthread.php?t=80061) ... i guess it all depends on the key words used in the search.. anyways here is what i did:

in the store:

fields : [
{name: 'log_date', mapping: 'log_date', convert: function(v){
return v ? v.date : '';
}, type: 'date', dateFormat: 'Y-m-d HH:mm:ss'},
and on the grid:

{header: 'Date', width: 30, sortable: true, dataIndex: 'log_date'},

but im not so sure that the columns is being treated as correct date because if i try to sort (by clicking on the column header) it does not sort at all?