Search code examples
javajspextjsextjs3

Edit text field in extjs


I have a text field which is populated by ExtJS DateField and the format for that should be "m/d/y G:i" which is then passed to Java and then to a stored procedure that will fetch data from the table according to date & time specified.

Ext.each(textFields, function(textField) {
    var dateField = new Ext.form.DateField({
        allowBlank:false,
        format:'m/d/Y G:i',
        style: {
            height: '22px',
            fontFamily: 'Verdana',
            fontSize: '10px',
            float: 'left',
            marginTop: "1px"
        },
        applyTo: textField
    });
    dateFields.push(dateField)    
});

How to hide the time format displayed in text field, but the current system time should be passed to Java.


Solution

  • there is both a format and a submitFormat config int the Ext.form.DateField class