-
13 Nov 2012 3:26 AM #1
datepickerfield with picker freez the app
datepickerfield with picker freez the app
Ext version tested:
- Sencha Touch 2.1.0
- Chrome 20.0.1132.47 m
- <!DOCTYPE HTML>
- When trying to choose a date in datepickerfield, navigator freez and don't respond
- Application is a Sencha MVC application
- Just add this code in anyone forms view:
- Code:
{ xtype: "datepickerfield", label: "date", margin: "1.2em 0em 0em 0em", dateFormat: "d/m/Y", picker: { yearFrom: Ext.Date.format(Ext.Date.add(new Date(), Ext.Date.YEAR, -10), "Y"), yearTo: Ext.Date.format(Ext.Date.add(new Date(), Ext.Date.YEAR, 20), "Y") }, action: "dluoMin" }
- datepicker must show taking care of year initialization in picker
- navigator freez.
To reproduce go on: http://docs.sencha.com/touch/2-1/#!/api/Ext.field.DatePicker
In the codeEditor of example add below code to datepickerfield configuration:
INFORMATIONScreenshot or Video:Code:picker: { yearFrom: Ext.Date.format(Ext.Date.add(new Date(), Ext.Date.YEAR, -10), "Y"), yearTo: Ext.Date.format(Ext.Date.add(new Date(), Ext.Date.YEAR, 20), "Y") },- /
- /
- /
- /
- WinXP Pro
-
13 Nov 2012 5:50 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
The reason for this is yearFrom/yearTo expect an integer where you are providing a string.
So you can work around it currently by doing this:Code:Ext.Date.format(Ext.Date.add(new Date(), Ext.Date.YEAR, -10), 'Y') === '2002'
Now I think we can do the parseInt in the framework to protect things if we can so I will open as a bug.Code:{ xtype : 'datepickerfield', label : 'date', margin : '1.2em 0em 0em 0em', dateFormat : 'd/m/Y', picker : { yearFrom : parseInt(Ext.Date.format(Ext.Date.add(new Date(), Ext.Date.YEAR, -10), 'Y')), yearTo : parseInt(Ext.Date.format(Ext.Date.add(new Date(), Ext.Date.YEAR, 20), 'Y')) }, action : 'dluoMin' }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.
-
14 Nov 2012 8:08 AM #3
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-3695
in
Sprint 28.


Reply With Quote