-
26 Nov 2012 1:54 AM #1
DatePicker Field with clearIcon not clearing the date
DatePicker Field with clearIcon not clearing the date
REQUIRED INFORMATION
Ext version tested:- Sencha Touch 2.1.0
- Chrome
- Date picker with clearIcon set to true is not clearing the box
- 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
- Expected to have the date deleted
- Date picker appears
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
-
26 Nov 2012 6:25 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,637
- Vote Rating
- 435
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 @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
26 Nov 2012 6:29 AM #3
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 Dec 2012 6:36 AM #4
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.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote