REQUIRED INFORMATION




Ext version tested:
  • Sencha Touch 2.1.0
Browser versions tested against:
  • Chrome
Description:
  • Date picker with clearIcon set to true is not clearing the box
Steps to reproduce the problem:
  • Create a form with a date field (Ext.field.DatePicker) with clearIcon set to true, both the clear icon and the select selector arrow appears, when clicking (tapping) on the clear icon the picker appears
The result that was expected:
  • Expected to have the date deleted
The result that occurs instead:
  • Date picker appears
Test Case:
This is our DatePicker implementation:
Code:
    Ext.define('Application.field.Date',
{
    extend: 'Ext.field.DatePicker',
    xtype: 'appdate',
    
    config:
    {
        dateFormat : 'd M Y',
        picker:
        {
            yearFrom : new Date().getYear() + 1900 - 50,
            yearTo : new Date().getYear() + 1900 + 20
        },
        clearIcon : true
    },
    
    initialize: function()
    {
        this.createPicker();
        this.callParent();
    },
    
    createPicker : function()
    {
        var picker = this._picker,
            value = this.getValue();
        
        if (picker && !picker.isPicker)
        {
            picker = Ext.factory(picker, Ext.picker.Date);
            if (value != null) 
            {
                picker.setValue(value);
            }
        }
        
        picker.on(
        {
            scope: this,
            change: 'onPickerChange',
            hide  : 'onPickerHide',
            show : function()
            {
                this._picker.applyCancelButton(Application.getText('cancel'));
                this._picker.applyDoneButton(Application.getText('done'));
            }
        });
        this._picker = picker;
        return picker;
    }
});





HELPFUL INFORMATION