Grid 如何从extjs 4.2网格中的日期选择器中删除时间戳

Grid 如何从extjs 4.2网格中的日期选择器中删除时间戳,grid,datepicker,extjs4.2,Grid,Datepicker,Extjs4.2,我的网格的日期列编辑器中提到了一个datefield xtype,一旦我从选择器中选择了任何日期,只要我不单击外部或按Enter键,日期就会以默认格式显示,即“d/m/Y”(意思是dd/mm/YYYY)。但只要我在单元格外单击或按enter键,它就会更改为包含时间戳的整个日期。我怎么能不让这种事发生?我想保持d/m/Y格式,不想显示时间或日期 下面是一个例子,说明我按enter键后它会变成什么样子 2013年5月28日星期二00:00:00 GMT+0530(印度标准时间) 我希望是这样 201

我的网格的日期列编辑器中提到了一个datefield xtype,一旦我从选择器中选择了任何日期,只要我不单击外部或按Enter键,日期就会以默认格式显示,即“d/m/Y”(意思是dd/mm/YYYY)。但只要我在单元格外单击或按enter键,它就会更改为包含时间戳的整个日期。我怎么能不让这种事发生?我想保持d/m/Y格式,不想显示时间或日期

下面是一个例子,说明我按enter键后它会变成什么样子

2013年5月28日星期二00:00:00 GMT+0530(印度标准时间)

我希望是这样

2013年5月28日或2013年5月28日星期二

如何做到这一点

下面给出了我对该列的配置

editor: {
    xtype: 'datefield',
    anchor: '100%',
    format: 'd/m/Y',
    submitFormat: 'd/m/Y',
    minValue: new Date()
}

请参考下面的代码,让我知道它是否工作

editor: {
    xtype: 'datefield',
    anchor: '100%',
    format: 'd/m/Y',
    submitFormat: 'd/m/Y',
    minValue: new Date(),
    listeners : {
               render : function(datefield) {
                   // code to convert GMT String to date object
                   datefield.setValue(new Date());
               }
    }
}

谢谢

当您使用日期字段时,它会在模型上设置日期类型

在网格单元上使用渲染器(假定字段类型为date):


1在模型中定义日期字段-

{name: 'date', type: 'date', dateFormat: 'Y/m/d'} {name:'date',type:'date',dateFormat:'Y/m/d'} 2在使用日期选择器的网格配置列中使用以下内容-

{header: 'Date', xtype:'datecolumn', width: 200, dataIndex:'date', editor:{xtype: 'datefield', format:'Y/m/d', allowBlank:'fasle'}} {header:'Date',xtype:'datecolumn',宽度:200,数据索引:'Date',编辑器:{xtype:'datefield',格式:'Y/m/d',allowBlank:'fasle'}} {header: 'Date', xtype:'datecolumn', width: 200, dataIndex:'date', editor:{xtype: 'datefield', format:'Y/m/d', allowBlank:'fasle'}}