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
    St. Louis, MO
    Posts
    33,624
    Vote Rating
    434
    Answers
    3105
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      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
    ________________
    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.

  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