3

I have a grid with a Column configured like...

{
   ...
   editor:new Ext.form.DateField({format:'m/d/Y'}),
   renderer: function (val){return val ? Ext.util.Format.date(val, 'm/d/Y') : ''}
   ...
}

It works fine, except that when I click on a cell to edit it, the cell gets blanked out rather than maintaining its existing value until I choose new one. If after clicking the cell I click away from it, the cell is left empty.

Any idea what would cause this?

Thanks

dublxdad
  • 153
  • 1
  • 12

2 Answers2

0

I would have thought you'd want your column defined like this:

columns: [{
    xtype: 'datecolumn', 
    format: 'm/d/Y',
    editor: {
        xtype: 'datefield'
    }
}]

I don't think you need to use a renderer or use create are you are using it in your example

dougajmcdonald
  • 19,231
  • 12
  • 56
  • 89
0

I've had a similar problem, and solved it somewhat with setting allowBlank: false, as below:

...
editor:new Ext.form.DateField({
    format:'m/d/Y',
    allowBlank: false
}),
...

This should reset the value back to its original value if you click out of the datefield without selecting a new value.

David Smithson
  • 464
  • 2
  • 13
  • 33
  • How to retain the old value and edit the same rather than , going blank and choosing the new one –  Mar 21 '17 at 13:00