-
6 Apr 2012 3:31 AM #1
how to clear timefield list selection on field reset?
how to clear timefield list selection on field reset?
How can i clear selection from timefield drop down list on field reset or value being set?
1. If i once pick any item it stays (visibly) selected event after reset or setting field value.
2. clicking on that phantom selected item results in no action (it cant be selected even if field real value is null);
tested under chrome on extjs 4.0 (http://docs.sencha.com/ext-js/4-0/)Code:Ext.create('Ext.Window',{ autoShow:true, width:200, autoDestroy:true, layout:'anchor', items:[ {xtype:'timefield'}, {xtype:'button',text:'reset',handler:function(){ this.previousSibling().reset(); }} ] });
PS. I guess it is a bug but i need answer rather than "new verion will be fixed" message.
-
6 Apr 2012 7:39 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,128
- Vote Rating
- 453
I am opening a bug report for this. If you need a work around, I would invite you to open a ticket at http://support.sencha.com/
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.
-
7 Apr 2012 5:04 AM #3
Code:Ext.create('Ext.Window',{ autoShow:true, width:200, autoDestroy:true, layout:'anchor', items:[ {xtype:'timefield', autoSelect: false}, {xtype:'button',text:'reset',handler:function(){ this.previousSibling().reset(); }} ] });Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
9 Apr 2012 10:05 PM #4
@mitchellsimoens - thank You.
@Animal- sadly that didnt change anything. The problem is, as i tried to explain, that after selecting an item and reseting field, previous value is still (visibly) set on the dropdown list AND it cant be selected again (until some other item is selected first).
-
12 Apr 2012 1:07 PM #5
I got around this by clearing the selection model. There is probably a much better way, but this what I came up with after fighting with this for a couple days.
So far I have not noticed any unexpected side effect.Code:Ext.override(Ext.form.field.Time, { reset: function() { this.callParent(); this.applyEmptyText(); this.getPicker().getSelectionModel().suspendEvents(false); this.getPicker().getSelectionModel().deselectAll(true); this.getPicker().getSelectionModel().resumeEvents(); } });
-
12 Apr 2012 10:25 PM #6
Thanks a lot Mr Ersts. Thats good enough for me. I ll use it in the project..
However there is still one small glitch. After reset previously selected item is still marked as selected but now this marking disapears on list mouseon and it can be easily selected again. case closed.
PS1. This will surely be sufficient until 4.1 release.
PS2. I' d marki it as a best answer but the thread was moved from questions to bugs.
PS3. Congratulations! - Your first post and straightaway most helpful. cheers!
-
13 Apr 2012 8:22 AM #7Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
You found a bug! We've classified it as
EXTJSIV-5865
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote