-
22 Nov 2011 3:47 PM #1
Unanswered: How do I use a spinner where the display value is different from value?
Unanswered: How do I use a spinner where the display value is different from value?
Hi,
How do I use a spinner where display value is different from value?
ie.
I have a spinner with the values being the date format, but when I display the value,
I want to display the formatted date, instead of the format itself.
I tried processRawValue but this isn't it.
xtype: 'spinnerfield',
fieldLabel: 'Date Format',
options: ["F j, Y", "D, F j, Y", "m-d-Y", "Y-m-d", "m/d/Y", "Y/m/d"], // this is my field
processRawValue: function(v) {
return Ext.Date.format(new Date(), v);
},
Thanks
John
-
23 Nov 2011 6:34 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 436
- Answers
- 3113
Are you only using the core or are you using Ext JS 3/4?
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.
-
5 Dec 2011 6:10 PM #3
-
6 Dec 2011 3:52 PM #4
You should consider using separate components (spinner fields) for each section of the date time... Then merge the values of those spinner fields into a single hidden form element using the desired format.
Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...
When in doubt, check the d4mn source code!


Reply With Quote