PDA

View Full Version : The date format of DateField



linuxyf
24 Nov 2010, 5:47 PM
In a GridPanle, i use the DateField as the column editor, After selecting a date, and loosing it's focus, the selected data becomes into this:
Tue Feb 17 00:00:00 UTC-0300 2009
Instead of 2009/02/17 (wich is the format I've set: Y/m/d)

my part code is as following:
serchResultGrid = new Ext.grid.GridPanel({
frame: true,
title: 'search result',
autoScroll: true,
height: 300,
store: store_serchResult,
plugins: [editor],
colModel: serchResultGridcolModel,
viewConfig: {
forceFit: true
}
});

var editor = new Ext.ux.grid.RowEditor({
saveText: 'Update'
});

var serchResultGridcolModel = new Ext.grid.ColumnModel({
defaults: {
width: 50
},
columns: serchresultColModelAllay
});

serchresultColModelAllay[index] = new Ext.grid.Column({
header: record.get('header'),
width: Number(record.get('width')),
sortable: record.get('sortable'),
dataIndex: record.get('dataIndex'),
editor: new Ext.form.TextField({}),
editable: Boolean(record.get('editable')),
format: record.get('format')
});

Condor
25 Nov 2010, 7:25 AM
When the editor is not active the renderer is responsible for displaying the value.

Either write a renderer that properly formats the date or specify xtype:'datecolumn' and a format.