Dibish
Dibish

Reputation: 9303

Sencha touch selectfield Placeholder

How can i add a selectfield placeHolder in sencha touch..

here is my code

{
                        xtype: 'selectfield',
                        label: 'Subclient',
                        itemId: 'subclient',
                        name: 'subclient',
                        labelWrap:'true',
                        autoSelect:'false',
                        placeHolder:'Select',
                        required:true,

                        //labelWidth: '40%',

                        options: [
                            {text: 'Standard Sale', value: 'Standard Sale'},
                            {text: 'Short Sale',  value: 'Bank of America'},
                            {text: 'REO',  value: 'REO'}
                        ]
                    },

Here the placeholder is not visible..i can only managed to see the first text value option in da list.

i tried by adding

 {text: 'Select a Client', value: 'Select'},

As the first option but, in this case i cannot able to validate it using my model validation.. Any one plz help me to solve this issue ..your help is much appreciated ..Thanks in Advance

Upvotes: 1

Views: 2043

Answers (1)

kevhender
kevhender

Reputation: 4405

Remove the quotes from around the false for the autoSelect property (and ALL boolean config options):

{
    xtype: 'selectfield',
    label: 'Subclient',
    itemId: 'subclient',
    name: 'subclient',
    labelWrap: true,
    autoSelect: false,
    placeHolder: 'Select',
    required: true,

    options: [
        {text: 'Standard Sale', value: 'Standard Sale'},
        {text: 'Short Sale',  value: 'Bank of America'},
        {text: 'REO',  value: 'REO'}
    ]

},

Upvotes: 2

Related Questions