-
12 Dec 2011 8:02 AM #1
Unanswered: Picker - how to set the default slot value
Unanswered: Picker - how to set the default slot value
When the Picker is shown - it offers the first value in data to select.
How can I force it to start with other value, kind of 'default' value ?
Thanks
-
12 Dec 2011 9:10 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,624
- Vote Rating
- 434
- Answers
- 3105
Each slot can have a value config. Each slot has a setValue method. Ext.Picker has a setValue method.
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.
-
13 Dec 2011 5:45 AM #3
code fragment
code fragment
Thank you Mitchell for the hint.
Below is a fragment of code that works for me:
The value property is missing from Sencha API documentations for PickerCode:var picker = new Ext.Picker({ slots: [ { name : 'day', data: [ {text: 'Mon, Dec 12', value: 1}, {text: 'Tue, Dec 13', value: 2}, {text: 'Wed, Dec 14', value: 3}, {text: 'Thu, Dec 15', value: 4}, {text: 'Fri, Dec 16', value: 5}, {text: 'Sat, Dec 17', value: 6}, {text: 'Sun, Dec 18', value: 7} ], value: 2 } ] });


Reply With Quote