Search code examples
extjsextjs5extjs-grid

Extjs 5 editing grid: datefield editor prevention of validation and completing the edit anyway


I have a table with cell editor of datefield, I want it to accept the value even if it's invalid date, without parsing and validating it. If I entered a valid date, the edit event get fired. for invalid date, the canceledit event get fired automatically. I want to enter dates of multiple formats, or even my own formats, and do the validation afterwards in the edit event.

I couldn't post any code here because the project I'm working on is enormous, but I'm pretty sure it's some configuration I need to add to the grid, the datefield editor, or the editing plugin.

any experience here?


Solution

  • Ext.define('GenericDateField', {
        extend: 'Ext.form.field.Date',
        alias: 'widget.genericDateField',
        selectOnFocus : true,
        format : 'd/m/Y',
        altFormats: 'd/m/y|d-m-y|d-m-Y|d/m|d-m|dm|dmY|dmy|d|dm|Y-m-d',
        validateValue: function(){
            return true;
        }
    });