1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    2
    Vote Rating
    0
    Michael.Dine is on a distinguished road

      0  

    Default 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

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,620
    Answers
    3452
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    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
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Jul 2011
    Posts
    2
    Vote Rating
    0
    Michael.Dine is on a distinguished road

      0  

    Thumbs up code fragment

    code fragment


    Thank you Mitchell for the hint.

    Below is a fragment of code that works for me:
    Code:
    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
            }
         ]
    });
    The value property is missing from Sencha API documentations for Picker

  4. #4
    Sencha Premium Member
    Join Date
    Feb 2014
    Posts
    12
    Vote Rating
    0
    Wawrowski900123 is on a distinguished road

      0  

    Default


    Hey,
    i have the Problem, if i set a name for the slot, i cannot set the Value for the Picker .... When i work without name for the Picker, the value is working ....
    Any ideas why i have this Problem ???