Results 1 to 4 of 4

Thread: DatePicker Field with clearIcon not clearing the date

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium Member
    Join Date
    Nov 2012
    Posts
    15
    Vote Rating
    0
      0  

    Default DatePicker Field with clearIcon not clearing the date

    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

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      0  

    Default

    This is not a bug but intended behavior. The reason is we capture the tap on where the field is to open the picker which the clearIcon is under.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2012
    Posts
    15
    Vote Rating
    0
      0  

    Default

    Hi Mitchell

    I understand the desired behavior but I also would say that showing a clear button that does not clear the field is, if not a bug, an undesired behavior. Also the clear icon appears on top of the selector's triangle which makes it ugly.

    Is there a workaround for this? We would like our customers to be able to clear the date, probably more people will want this also.

    Thanks and regards

  4. #4
    Sencha Premium Member
    Join Date
    Nov 2012
    Posts
    15
    Vote Rating
    0
      0  

    Default

    Sorry, it is not clear if this is being looked at or if the previous reply was an official statement, in case it was I will create another topic in the Q&A forum in order to resolve this problem.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •